BSD socket, read and write using the same socket ...

R. Kannan kannan at cerc.wvu.wvnet.edu
Thu Oct 26 01:19:23 AEST 1989


Hai

	Can someone give us some idea with the following problem:

The scenario:

	open a socket, s.

	accept a connection on s, resulting in a file descriptor fd.

	read a socket number and a destination from the fd.

	close fd.

	connect the socket s to the received socket number at the destination.

The problem:
	Never seems to connect. It times out.
	

	However if we get a new socket and try to connect to the received 
	port at the destination, everything works fine.


HELP: can anyone explain what is wrong in this approach. We have other code 
where we read and write during the same TCP connection. Here the first
connection is to read the socket port number for the second one. 



More information about the Comp.unix.wizards mailing list