socket problem?

Brian Dear briand at rfengr.com
Tue May 21 07:09:23 AEST 1991


Question about sockets.  I've got a simple server program that runs in the
background.  It sits in an infinite loop, with an accept() call, waiting
for a client's request.  And a request comes in, it executes a read(). 
The read() function reads a single char; with that char I know what type of
request the client's making.  If the single char is 'r', for instance, 
the server sends out a write() of a struct 10000 or so bytes long. 
That all works fine.

It's the client side that's got a bug.  It sets up its socket with
the server successfully, connect()'s successfully, etc.  Sends out 
its 'r' successfully (cuz the server gets it and sends out its struct)
but the client's read() never works.  The client has a read() function
such as this

	read( sd, &theStruct, sizeof(theStruct) );

where sd is the socket descriptor and theStruct is just some big structure.
Read returns a value of 3 or it just blocks altogether.  Any ideas?

Please direct any replies to "brian at coconut.com" -- Thanks!

Brian Dear     Coconut Computing, Inc.    brian at coconut.com



More information about the Comp.unix.wizards mailing list