Hello Werner,

> When the server listen to port 2500, and the socket port start increasing
> from 2000. Do I get in trouble when it comes finaly to port 2489,2499..2500
> the same port where the server is listening, or is this handled automaticaly

No the OS will skip port 2500 and will get the first next free port.
Probably 2501.

> command, then close again. And I see the port increasing fast, what about a
> limit ? can I reset the portnumber?

No you cannot reset, but normally no problem. There are 65535 ports. And
the TIME_WAIT ports will be released after 2 minutes. So a long time
before yoiu have reach the highest port the low ones are free again, so
OS will get ports back on the low range.

> The client has port 2000. When the client change his port to 2001, is there
> a way, when connecting to the server to retreive the clients actual port
> address?. I must know this port because I need to contact this client back
> on an other WSocket. Ofcourse it wil work fine if the client don't change
> his port number.

I dont understeand the question. Can you explain again please ? Do you
mean with 'Client' the 'Datasocket' of the server where you are
connected with ? If so then this socket is released when tcp session is
closed, but please explain again, it is not clear to me what you wants.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Friday, March 31, 2006, 10:46, Werner wrote:

> Thank Wilfried, thats explains a lot.

> When the server listen to port 2500, and the socket port start increasing
> from 2000. Do I get in trouble when it comes finaly to port 2489,2499..2500
> the same port where the server is listening, or is this handled automaticaly
> by the socket that the increasing port will never be the listening server
> port ?
> To explain more: my program get every 10 seconds an incoming client, get the
> command, then close again. And I see the port increasing fast, what about a
> limit ? can I reset the portnumber?, it's a black hole for me.

> The client has port 2000. When the client change his port to 2001, is there
> a way, when connecting to the server to retreive the clients actual port
> address?. I must know this port because I need to contact this client back
> on an other WSocket. Ofcourse it wil work fine if the client don't change
> his port number.

> Thanks a lot
> Werner


> ----- Oorspronkelijk bericht ----- 
> Van: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
> Aan: "ICS support mailing" <twsocket@elists.org>
> Verzonden: vrijdag, maart 31, 2006 10:11
> Onderwerp: Re: [twsocket] Port number


>> Hello Werner,
>>
>> It is the exact peer port. I try to explain:
>>
>> -- for a server --
>> Server listens on a certain addr:port. Client connect to that port, but
>> server should stay listening, so the listening port has to be kept free,
>> so as fast as possible the socket is duped to another local port. This
>> port increase after each connect because the OS hold it in time_wait
>>
>> -- for a client --
>> Client connect to a certain addr:port. But local it is also bound to an
>> addr and port. This is the peer port when it is called by the server
>> end.
>>
>> ---
>> Rgds, Wilfried [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> http://www.mestdagh.biz
>>
>> Thursday, March 30, 2006, 20:58, Werner wrote:
>>
>> > Hi All,
>>
>> > Using WSocket and GetPeerPort. The client has for example port 2000
>> > When recieving a package then close again, then recieving -close,
>> > etc I receive 2001 then next package 2002, 2003, etc. as portNumber
>> > The portnumber seems to increase all the time, and not giving me
>> > the exact PeerPort like the PeerAddr wich is correct.
>>
>> > GetPeerPort , PeerPort give me not the peerport from the client.
>> > I have tested this in a local lan, maybe this would be the problem ?
>>
>> > Any idee how to get the actual portnumber from the client side, when the
> client is connected
>> > Thanks for any suggestions
>> > Greetings - Werner
>>
>>
>> -- 
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://www.elists.org/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>>
>>


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to