Re: [twsocket] Port number
Yes, Wildried I had that in mind, but was hoping to get it from a function. But knowing that I'm not running out of serverports, give me better dreams Thanks a lot Werner - Oorspronkelijk bericht - Van: "Wilfried Mestdagh" <[EMAIL PROTECTED]> Aan: "ICS support mailing" Verzonden: vrijdag, maart 31, 2006 12:41 Onderwerp: Re: [twsocket] Port number > Hello Werner, > > You have to make a little protocol for that. B listens on a know > IP:Port. A connect to B and tells B the port he will listen on in the > protocol. Then later B can connect to A because he know the listening > port by then. > > --- > Rgds, Wilfried [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > http://www.mestdagh.biz > > Friday, March 31, 2006, 11:47, Werner wrote: > > > > > On a second session, the server turns client, and client turns server: > > client(ComputerA) port 2000 -> connect server(ComputerB) at port 2500. Close > > connection ( ComputerB knows the adress, and gets the clients actual port, > > in someway) > > then > > client(ComputerB) port 2500 -> connect server(ComputerA) at port 2000. Close > > connection. (This works fine when the ComputerA has a fix port adress) > > > The things is, when a new client access the server at an ipaddress, this > > server( wich will be a clientSocket at that moment) needs to know the actual > > port number to connect the client back (wich will be a serverSocket at that > > moment). On a later moment. > > So each computer has a client and serverSocket running. > > > > >> > >> > 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" > >> > 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 > >> &
Re: [twsocket] Port number
Hello Werner, You have to make a little protocol for that. B listens on a know IP:Port. A connect to B and tells B the port he will listen on in the protocol. Then later B can connect to A because he know the listening port by then. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, March 31, 2006, 11:47, Werner wrote: > On a second session, the server turns client, and client turns server: > client(ComputerA) port 2000 -> connect server(ComputerB) at port 2500. Close > connection ( ComputerB knows the adress, and gets the clients actual port, > in someway) > then > client(ComputerB) port 2500 -> connect server(ComputerA) at port 2000. Close > connection. (This works fine when the ComputerA has a fix port adress) > The things is, when a new client access the server at an ipaddress, this > server( wich will be a clientSocket at that moment) needs to know the actual > port number to connect the client back (wich will be a serverSocket at that > moment). On a later moment. > So each computer has a client and serverSocket running. >> >> > 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" >> > 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
Re: [twsocket] Port number
Hello Frans, > was the default not 240seconds, posible minumum value 30sec ? And the port > limited by maxuserport? Yes I think you are right. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- 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
Re: [twsocket] Port number
On a second session, the server turns client, and client turns server: client(ComputerA) port 2000 -> connect server(ComputerB) at port 2500. Close connection ( ComputerB knows the adress, and gets the clients actual port, in someway) then client(ComputerB) port 2500 -> connect server(ComputerA) at port 2000. Close connection. (This works fine when the ComputerA has a fix port adress) The things is, when a new client access the server at an ipaddress, this server( wich will be a clientSocket at that moment) needs to know the actual port number to connect the client back (wich will be a serverSocket at that moment). On a later moment. So each computer has a client and serverSocket running. > > > 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" > > 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 > > -- 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
Re: [twsocket] Port number
- Original Message - From: "Wilfried Mestdagh" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Friday, March 31, 2006 11:05 AM Subject: Re: [twsocket] Port number > 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. > was the default not 240seconds, posible minumum value 30sec ? And the port limited by maxuserport? -- 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
Re: [twsocket] Port number
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" > 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
Re: [twsocket] Port number
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" 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
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