No error while sending via TCP Socket
Laszlo Nagy
gandalf at designaproduct.biz
Fri Jun 30 05:57:55 EDT 2006
Laszlo Nagy írta:
> Ben Sizer írta:
>
>> Martin Bürkle wrote:
>>
>>
>>> I have writen a programm using TCP sockets. After i get the connection
>>> to another socket I cut the Ethernet cable. Then I send a message.
>>> The program doesnt raise any exception. Can somebody tell me why and
>>> give me a hint how to get an exception
>>>
>>>
>> Have you tried waiting 30 seconds or so? The connection may just take a
>> while to time out.
>>
>>
> I'm not sure if this will help him. He told that the program doesn't
> raise an exception. I suppose this also means that socket.send() was
> successful. If his program does not want to send or receive anything
> else, then he will not get an exception. Otherwise if socket.send()
> blocks his program, then you are right
Another idea: probably his message is too small to fit one TCP packet.
socket.send() succeeds, but the TCP packet is not sent out. By the time
the packet driver tries to send out the (short) TCP packet, the
socket.send() call is not active, so it cannot raise an exception.
Laszlo
More information about the Python-list
mailing list