Issue
After reading a post here, I thought that was possible to send arguments to my protocol factory using a lambda function, but for some reason, it just doesn't work (it doesn't recognize any connection). Since create_server doesn't accept arguments, how could I tell my protocol some useful information? I start a bunch of them using a loop for every door in a list, but after that, I can't relate to which protocol is which.
Any ideas?
Solution
Alright, I found the problem.
Instead of using the lambda like in the example:
await asyncio.start_server(lambda r, w: handle_client(r, w, session),
'', 55555)
I should be using lambda like this:
await asyncio.start_server(lambda: handle_client(r, w, session),
'', 55555)
I hope this may be helpful to someone else.
Answered By - Guilherme Richter
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.