Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

fix set_timeout only works before TSocket().open() #188

Merged
merged 1 commit into from
Mar 17, 2016
Merged

fix set_timeout only works before TSocket().open() #188

merged 1 commit into from
Mar 17, 2016

Conversation

damnever
Copy link
Contributor

No description provided.

@wooparadog
Copy link
Member

@lxyu

lxyu added a commit that referenced this pull request Mar 17, 2016
…socket_open

fix set_timeout only works before TSocket().open()
@lxyu lxyu merged commit 11aa134 into Thriftpy:develop Mar 17, 2016
@hit9
Copy link
Contributor

hit9 commented Mar 17, 2016

👍

@@ -78,6 +78,9 @@ def set_timeout(self, ms):
self.socket_timeout = ms / 1000 if (ms and ms > 0) else None
self.connect_timeout = self.socket_timeout

if self.sock is not None:
self.sock.settimeout(self.socket_timeout)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯...这个设置到原生socket上了 ,但是socket之后设置timeout就进入非阻塞模式了?有影响吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么会?设多少次都不会变成非阻塞模式吧。。。除非设为 0.0

@damnever damnever deleted the set_timeout_only_works_before_tsocket_open branch March 18, 2016 02:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants