[cse491] broken pipe when testing with script

C. Titus Brown ctb at msu.edu
Mon Sep 28 18:21:32 PDT 2009


On Mon, Sep 28, 2009 at 08:54:36PM -0400, Steve Wakeford wrote:
> First, I believe I am implementing all correctly but I am occasionally 
> getting a "socket.error: (32, 'Broken pipe')" exception.
> 
> I believe this is because my test script is closing the connection 
> before the server has sent its echo. If I put in a pause (i.e. 
> time.sleep(1)) before my socket.close() calls everything works fine.


That's... odd, but in any case your client script shouldn't be closing
the socket, right?  That's the job of the server, not the client (in
this specific case).

It sounds like your server is working correctly, though.

> Second, should the server only be echoing on newline? Currently I am 
> echoing every character as it comes in (including the '\n' and '.' 
> before ending connection). Just want to know if that's OK in 
> consideration of future projects.

That's fine.  The correspondence is going to get a lot pickier next week
(when we start speaking HTTP) but until then you're good ;)

--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list