Re: socket: connection reset by server before client gets response

2007-07-11 Thread Hendrik van Rooyen
"ahlongxp" <[EMAIL PROTECTED]> wrote: > I feel a little embarrassed now. There is nothing to be embarrassed about. Experience is a thing that is hard won. As someone once said: "no Pain, no Gain" - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: socket: connection reset by server before client gets response

2007-07-09 Thread ahlongxp
On Jul 9, 7:03 pm, Adriano Varoli Piazza <[EMAIL PROTECTED]> wrote: > ahlongxp wrote: > > I feel officially offended. > > I didn't intend to offend you, I was joking. I apologise in any case. > There's a few things to be said, though: > > As per your message in another thread, it isn't that you don

Re: socket: connection reset by server before client gets response

2007-07-09 Thread Adriano Varoli Piazza
ahlongxp wrote: > I feel officially offended. I didn't intend to offend you, I was joking. I apologise in any case. There's a few things to be said, though: As per your message in another thread, it isn't that you don't express yourself clearly in English, but that you were too quick to claim a s

Re: socket: connection reset by server before client gets response

2007-07-09 Thread ahlongxp
On Jul 9, 4:30 pm, Adriano Varoli Piazza <[EMAIL PROTECTED]> wrote: > > Gives a whole new meaning to chomp(), byte, nybble, and more :) > I wholeheartedly endorse this effort. I'm sick of reading about > students from WTF University (check thedailywtf.com if you don't know, > but beware. There be

Re: socket: connection reset by server before client gets response

2007-07-09 Thread Adriano Varoli Piazza
Hendrik van Rooyen wrote: > Sometimes I think that all would be programmers should be > forced to write a "Hello World" to transmit out of a serial port > in assembler on hardware that carries no OS - just to teach > them about interrupts and time. > > I would require them to hand assemble the code

Re: socket: connection reset by server before client gets response

2007-07-09 Thread ahlongxp
> It's a pleasure. > > Sometimes I think that all would be programmers should be > forced to write a "Hello World" to transmit out of a serial port > in assembler on hardware that carries no OS - just to teach > them about interrupts and time. > > I would require them to hand assemble the code too,

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Hendrik van Rooyen
"ahlongxp" <[EMAIL PROTECTED]> wrote: > > > Try to wait a while in the server thread, after sending the > > message before closing the connection, to give the message > > time to get transmitted. > > > > time.sleep(0.5) should do it... > > > > - Hendrik > > OMG, it works. > I can't believe the

Re: socket: connection reset by server before client gets response

2007-07-08 Thread ahlongxp
> Try to wait a while in the server thread, after sending the > message before closing the connection, to give the message > time to get transmitted. > > time.sleep(0.5) should do it... > > - Hendrik OMG, it works. I can't believe the problem can be solved so easily. Thanks very much. -- http:

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Hendrik van Rooyen
"ahlongxp" <[EMAIL PROTECTED]> wrote: > me again. > > "Connection reset by peer" happens about one in fifth. > I'm using python 2.5.1 and ubuntu 7.04. > Try to wait a while in the server thread, after sending the message before closing the connection, to give the message time to get transmi

Re: socket: connection reset by server before client gets response

2007-07-08 Thread ahlongxp
> So, umm, what exactly are you trying to accomplish? > It looks like what is happening is the server only accepts 99 bytes. It > then does the send and the close. yes. What I want is that, server sends response to client and closes connection when it feels recieving enough information, and mak

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Frank Swarbrick
ahlongxp wrote: >> Post the code. > ok. > here is the code: > > # Echo server program > import socket > > HOST = '' # Symbolic name meaning the local host > PORT = 50007 # Arbitrary non-privileged port > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.setsoc

Re: socket: connection reset by server before client gets response

2007-07-07 Thread ahlongxp
> Post the code. ok. here is the code: # Echo server program import socket HOST = '' # Symbolic name meaning the local host PORT = 50007 # Arbitrary non-privileged port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REU

Re: socket: connection reset by server before client gets response

2007-07-07 Thread Irmen de Jong
ahlongxp wrote: > me again. > > "Connection reset by peer" happens about one in fifth. > I'm using python 2.5.1 and ubuntu 7.04. > > -- > ahlongxp > > Software College,Northeastern University,China > [EMAIL PROTECTED]://www.herofit.cn > > Post the code. Without it we can only help when o

Re: socket: connection reset by server before client gets response

2007-07-07 Thread ahlongxp
me again. "Connection reset by peer" happens about one in fifth. I'm using python 2.5.1 and ubuntu 7.04. -- ahlongxp Software College,Northeastern University,China [EMAIL PROTECTED]://www.herofit.cn -- http://mail.python.org/mailman/listinfo/python-list

socket: connection reset by server before client gets response

2007-07-07 Thread ahlongxp
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides whether to accept(read) the body. if server decided to throw(dump) the request's body, it'll send