On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: > >> > >> What do you think of it? > > > > I found that we can't check connection status without select/poll > > on it. 'getsockopt()' will return 0 with no errors if connection > > is not still established just like if it was. > > So, I think, the first version of this patch is the only > > acceptable solution. > > Sorry, v2 is acceptable too, because it always calls 'connect()'.
So you have done the test that it works? I'm more curious to know could your above case hit the getsockopt() code path, I mean, the path that errno is set to EINPROGRESS or EISCONN? --yliu