Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Grant Edwards wrote:
>
>
>>If the server has closed the connection, then a recv() on the
>>socket will return an empty string "", and a send() on the
>>socket will raise an exception.
>
>
> Would that still apply when trying to send a
In message <[EMAIL PROTECTED]>, Grant Edwards wrote:
> If the server has closed the connection, then a recv() on the
> socket will return an empty string "", and a send() on the
> socket will raise an exception.
Would that still apply when trying to send an empty string?
--
http://mail.python.or
Grant Edwards wrote:
> If the server has closed the connection, then a recv() on the
> socket will return an empty string "",
after returning all the data the remote side had sent, of course.
> and a send() on the
> socket will raise an exception.
Send() might, and in many cases should, raise a
Grant Edwards <[EMAIL PROTECTED]> writes:
[...]
> > Often normal send() and recv() semantics have been mistaught.
> > An alert alien, looking at other common APIs in isolation,
> > might reasonably wonder whether there is some sort of
> > still_ok_to_use() sort of check as part of TCP. As it hap
[EMAIL PROTECTED] írta:
> ok, yeah, thats in my book.
> thanks, and no, it isn't enabled.
> thanks again for everything
> -sk
>
Another hint: use select.select() on the socket before reading. It will
tell you if recv() will block or not. This way you can implement your
own async timeout and do
ok, yeah, thats in my book.
thanks, and no, it isn't enabled.
thanks again for everything
-sk
Grant Edwards wrote:
> On 2006-07-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >> If the server _application_ crashes or exits, then the OS will
> >> close the socket and recv() will return "". If
On 2006-07-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> If the server _application_ crashes or exits, then the OS will
>> close the socket and recv() will return "". If somebody powers
>> down the server without warning, or if the server OS crashes,
>> or if the Ethernet cable between the I
> If the server _application_ crashes or exits, then the OS will
> close the socket and recv() will return "". If somebody powers
> down the server without warning, or if the server OS crashes,
> or if the Ethernet cable between the Internet and the server is
> cut, then the socket will not be clo
On 2006-07-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> oh, sorry, what i mean by dropped is that the server i am
> connecting to can close the connection.
Then recv() will return "" and send() will raise an exception.
> If that happens, i need to know about it. i also need to know
> about
oh, sorry, what i mean by dropped is that the server i am connecting to
can close the connection. If that happens, i need to know about it.
i also need to know about it if the server i am connecting to just
dies.
if recv() returns "" is that the same as NONE ?
again, sorry, i am still kinda new at
On 2006-07-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> hey there, i have a question about this solution.
> if i have a
> message = socket.recv()
> in the script, and the socket connection drops, will the
> socket.recv() just wait forever for something to come across
> the internet port? or
hey there, i have a question about this solution.
if i have a
message = socket.recv()
in the script, and the socket connection drops, will the
socket.recv() just wait forever for something to come across
the internet port? or will it know if the connection is dropped?
thanks.
-sk
Grant Edwards wr
On 2006-07-17, Cameron Laird <[EMAIL PROTECTED]> wrote:
>>> works well, but sometimes the server drops the connection. so,
>>> what i need is something that will let me know if the
>>> connection is still ok, if not will reconnect.
>>
>>If the server has closed the connection, then a recv() on the
In article <[EMAIL PROTECTED]>,
Grant Edwards <[EMAIL PROTECTED]> wrote:
>On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>> serverhost = 'xxx.xxx.xxx.xxx'
>> serverport = 9520
>> aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>> aeris_sockobj.connect((serverhost,s
cool enough, thanks !
-sk
Grant Edwards wrote:
> On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >> If the server has closed the connection, then a recv() on the
> >> socket will return an empty string "", and a send() on the
> >> socket will raise an exception.
>
> > like this ?
On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> If the server has closed the connection, then a recv() on the
>> socket will return an empty string "", and a send() on the
>> socket will raise an exception.
> like this ?
> databack = aeris_sockobj.recv(2048)
> if databack:
>
Grant Edwards wrote:
> On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > serverhost = 'xxx.xxx.xxx.xxx'
> > serverport = 9520
> > aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> > aeris_sockobj.connect((serverhost,serverport))
> >
> > while 1:
> > do this or
On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> serverhost = 'xxx.xxx.xxx.xxx'
> serverport = 9520
> aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> aeris_sockobj.connect((serverhost,serverport))
>
> while 1:
> do this or that with socket,
> send and recei
lo there,
i have a simple app that connects to a socket to get info from a server
i looks like this
serverhost = 'xxx.xxx.xxx.xxx'
serverport = 9520
aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
aeris_sockobj.connect((serverhost,serverport))
while 1:
do this or that with
19 matches
Mail list logo