Messages in this thread | | | Date | Mon, 25 Jan 2016 23:40:28 -0800 | Subject | Re: connection failure after "tcp: remove max_qlen_log" | From | Kui Zhang <> |
| |
I was using 2.7.11.
Older version did set backlog to 1 ( http://bugs.python.org/issue8498 ).
On Sun, Jan 24, 2016 at 7:18 PM, Eric Dumazet <edumazet@google.com> wrote: > On Sun, Jan 24, 2016 at 2:17 AM, Kui Zhang <kuizhang@gmail.com> wrote: >> We licensed the java software. As far as I can tell, the connection is >> for IPC with a child process. There should not be large RTT. >> >> I will contact vendor regarding to listen(fd,0) issue, on Monday. >> >> I am not fully convinced, that is the problem. I saw that man page for >> listen. However accept() works, in python, with backlog = 0. The java >> software works with kernel build one commit before. > > Note that python (2.4.6 here) translates sock.listen(0) to listen(fd, > 1), maybe to avoid surprises on some OS ;) > > $ cat lis.py > #!/usr/bin/python > > import socket > sock = socket.socket() > sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > sock.bind(('127.0.0.1',42000)) > sock.listen(0) > s, a= sock.accept() > > s.send('test') > > $ strace ./lis.py > ... > close(5) = 0 > close(4) = 0 > close(3) = 0 > futex(0x8d8e460, FUTEX_WAKE, 1) = 0 > socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 > setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 > bind(3, {sa_family=AF_INET, sin_port=htons(42000), > sin_addr=inet_addr("127.0.0.1")}, 16) = 0 > listen(3, 1) = 0 > accept(3,
| |