sockets and Windows behavior

Andre Garzia soapdog at mac.com
Fri Feb 11 12:56:33 EST 2005


On Feb 11, 2005, at 3:48 PM, John Rule wrote:

> Maybe someone can explain this...
>
>  I noticed that when a socket (regular or datagram) is opened to 
> Windows
> (via my app that is listening on port 1901), an 'alias' port is given
> instead of the 'real' one. For example, if my external device 
> (computer,
> PDA, etc.) connects to socket 192.168.77.10:1901 for communications, 
> the
> actual socket reported is a random number (like 1407), and it changes 
> each
> time the device connects (incrementally..1408, 1409, 1410).
>
> Is this Windows or RunRev?

John,

If I understand correcly what you've written, that's the normal TCP/IP 
behaviour. When a client connect to a server via a give port, the 
server will accept the connection and move the connection to a whole 
random free socket so that it can keep accepting connections on the 
given port (in your case, 1901). That's the standard way...

that way, you can connect two or more clients to the same server...

Andre
PS: hum... I think a little network foundations primer would be good... 
shall we write one?



>
> Thanks,
> JR
>
-- 
Andre Alves Garzia ð 2004
Soap Dog Studios - BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list