[ee122] Another Persistent Question -- does recv() block?

vern at cs.berkeley.edu vern at cs.berkeley.edu
Wed Oct 31 13:00:03 PDT 2007


> when using persistent connection, it seems like recv() blocks until  
> the server closes the connection.

Rather, it blocks when there's no data to read.  You might be running into
a situation where you've called it even though your server isn't going to
send anything more (like a 4xx response for which the server isn't
including an entity).

> if this is true, how should we  
> keep connections alive?

I'm not sure what you mean by "alive" here.  TCP connections stay established
indefinitely.

		Vern


More information about the ee122 mailing list