Skip to content

Conversation

@lemoer
Copy link

@lemoer lemoer commented Jun 5, 2016

I tried to implement some timeouts. The result is a better connect/reconnect behavior.

What do you think about it?

Implements #5

lemoer added 8 commits June 4, 2016 23:49
Because of the missing break statement, the
address family was set to IPv4 though we have
an aaaa record in the dns response.
Before this patch our thread was blocking as long
as the server does not send a message. Now we can
do additional stuff directly in this thread without
waiting for the server.
At some points it does not make sense to send the QUIT signal
before reconnecting.
This commit causes several changes to the internals of this
library. We are now using the python builtin modules "sched"
and "queue" to send and receive data. The connect function
is now blocking until we reach the connect_timeout or the
server sends the end of the motd.

There are two new configuration variables:

* connect_timeout
* reconnect_interval
The previous behavior was an exception because
self.outBuf is None in case of no connection.
With this patch the client is able to detect if the
connection to the server is lost. So he is able to
try to reconnect.

There are two new configuration variables:

* ping_timeout
* ping_interval
@fenhl fenhl merged commit 5e420ab into fenhl:master Jun 5, 2016
@fenhl
Copy link
Owner

fenhl commented Jun 5, 2016

I don't have any way to test the framework, but these changes are well explained and seem useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants