Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Knowing an IO::Socket handle has

by Everlasting God (Beadle)
on Jul 10, 2001 at 18:59 UTC ( [id://95321]=note: print w/replies, xml ) Need Help??


in reply to Knowing an IO::Socket handle has reached end-of-file

Depends on the socket type. Tcp sockets are 'connection oriented', meaning that there is a definite begining and end to the communication channel. These states are singnaled by various controll packets, including a request to open a connection (ok, so it's not quite that simple, with the sync handshaking and whatnot, but that's not important) and one to close it, definitively signaling the end of data, until the connection is reopened.

I don't have a clue about what the server you are connecting to is doing, but there is the posibility that is doesn't close the connection when it is through with a block of data, presumably is anticipation of more data to be sent, but I think it would send an eof or eot char. Don't quote me on that last bit though, can't remember off the top of my head. Time to go grab the crab book...

Udp, on the other hand, is message oriented, so a listening socket is always ready to recieve data, and if said data happend to include a listening udp port address on the sending machine (a pretty common practice) then a two way data flow can be established, but one can never know if this is the last packet, short of knowing that the remote machine is no longer up or reachable.

Sounds like you are using tcp connections, so there is a definite and signaled end to the connection.


'The fickle fascination of and Everlasting God' - Billy Corgan, The Smashing Pumpkins

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://95321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-25 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found