Xref: utzoo comp.unix.questions:17209 comp.unix.wizards:18948 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!aplcen!haven!h.cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!kannan From: kannan@cerc.wvu.wvnet.edu (R. Kannan) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: BSD socket, read and write using the same socket ... Keywords: socket Message-ID: <287@cerc.wvu.wvnet.edu.edu> Date: 25 Oct 89 15:19:23 GMT Sender: news@cerc.wvu.wvnet.edu Lines: 27 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.