-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of high connection latency #671
Conversation
pass | ||
if self._keep_alive: | ||
sock = self.transport.get_extra_info('socket') | ||
sock.setsockopt(socket.IPPROTO_TCP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to make sure a socket was actually returned and the type of the socket is TCP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
Added |
@fafhrd91 are you agree with PR? |
i still think tcp_nodelay should be on by default. otherwise i am fine |
# transport is closed | ||
return | ||
sock = self.transport.get_extra_info('socket') | ||
if sock.family not in (socket.AF_INET, socket.AF_INET6): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transports need not have a socket
, i.e. get_extra_info('socket')
might return a None
.
So, should probably do a if sock and sock.family not in (socket.AF_INET, socket.AF_INET6)
to be on the safe side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asvetlov I agree with @jashandeep-sohi
Close in favor of #680 |
Fix for #448