Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!mvb.saic.com!ncr-sd!serene!briand From: briand@rfengr.com (Brian Dear) Newsgroups: comp.unix.wizards Subject: socket problem? Summary: reading from a socket Keywords: socket read Message-ID: <1991May20.210923.12177@rfengr.com> Date: 20 May 91 21:09:23 GMT Reply-To: brian@coconut.com Organization: Coconut Computing, Inc., La Jolla, CA Lines: 23 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@coconut.com" -- Thanks! Brian Dear Coconut Computing, Inc. brian@coconut.com