Hi , This error comes when server port are in use . For overcome this problem kill this port whatever u have given in that program as an argument for listen
for killing port use this command kill -9 <portno> and again run server first and then run client. let do this and update me whether u r getting this error or not. -Ravi On Tue, Aug 26, 2008 at 7:00 PM, John Matthews <[EMAIL PROTECTED]> wrote: > I've got a client and server program communicating over a stream > socket. They are C programs compiled using gcc running under Linux. > > The server calls socket(), bind(), listen(), then loops round calling > accept() and creating a thread to read() messages on the connection. > The thread exits when the read() returns 0 (indicating EOF on the socket). > > The client calls socket() and connect() to connect to the server, then > write() to send messages to it. > > This all works fine, until I stop the programs using CTRL-C. Then when > I re-run the server I sometimes get a 'address already in use' > returned by bind(). However, if I wait a minute or 2, it's ok again. > > I guess it's because I'm not closing down the socket properly or > something. I'm no socket expert - what am I missing out? > > Cheers > John > > > [Non-text portions of this message have been removed]
