On Sat, Apr 19, 2008 at 3:54 AM, Serge Belyshev <belyshev@xxxxxxxxxxxxxxxxx> wrote: > changed subject to highlight the issue. > > David Stevens <dlstevens@xxxxxxxxxx> writes: > > > > But nothing was listen()'ing on the port and nothing accept()'ed the > >> connection. > >> > >> If you had similar code running on two different machines, each of which > >> attempted connections to the other machine, I would expect that they > >> would never connect because of the asymetric nature of the TCP SYN, > >> SYN/ACK, ACK connection sequence. > > > > You don't have to listen to do a connect. Two programs (on different > > machines or not) that are doing cross connects works, too. > > > > +-DLS > > But my socket is unbound and I'm connecting to a loopback address, so > I expect the connection to fail if nobody listens on the port I am > connecting to. Yet the connections succeedes on the rare occasion when > the kernel chooses the source port number that matches the destination. kernel never provided the Client port address less then 1024 number. and there are no process with port number more than 1024 which can listen default in kernel. that means you have to create a listening port with number more than 1024 and only you can connect to the listing port otherwise it says connect: Connection refused. > -- > To unsubscribe from this list: send the line "unsubscribe linux-net" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html