change port for web server

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

change port for web server

vincent cui

Hi all:

 

I develop a web server with LWIP SOCKET API, it has a function which could change HTTP port value and relogin again .

After apply for new HTTP port, it also needs wait 2min to make sure TCP is in timeout state ?

 

 

Vincent  


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: change port for web server

Kieran Mansley

On 7 Aug 2012, at 06:01, vincent cui wrote:

> I develop a web server with LWIP SOCKET API, it has a function which could change HTTP port value and relogin again .
> After apply for new HTTP port, it also needs wait 2min to make sure TCP is in timeout state ?

No, the only time you need to wait for a timeout is if the socket is in the TCP time-wait state and you want to re-use the same port.    If you're using a new port then the time-wait state should not matter.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: change port for web server

vincent cui
HI :

How to know the socket is in TCP time-wait state ?
If I apply for new port, I need delete the current web server task and create new task again .

Vincent  

-----Original Message-----
From: lwip-users-bounces+vincent.cui=[hidden email] [mailto:lwip-users-bounces+vincent.cui=[hidden email]] On Behalf Of Kieran Mansley
Sent: 2012年8月8日 2:37
To: Mailing list for lwIP users
Subject: Re: [lwip-users] change port for web server


On 7 Aug 2012, at 06:01, vincent cui wrote:

> I develop a web server with LWIP SOCKET API, it has a function which could change HTTP port value and relogin again .
> After apply for new HTTP port, it also needs wait 2min to make sure TCP is in timeout state ?

No, the only time you need to wait for a timeout is if the socket is in the TCP time-wait state and you want to re-use the same port.    If you're using a new port then the time-wait state should not matter.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: change port for web server

Kieran Mansley

On 8 Aug 2012, at 01:11, vincent cui wrote:

> How to know the socket is in TCP time-wait state ?

You can't.  Any socket that you have a file descriptor for is not in the time wait state.  If you find that you want to re-use a port on a new socket and can't because there is another socket in the time wait state you could consider using the SO_REUSEADDR socket option to allow you to re-use it immediately.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: change port for web server

vincent cui
Thank you very much ... I know how to go on .

Vincent  

-----Original Message-----
From: lwip-users-bounces+vincent.cui=[hidden email] [mailto:lwip-users-bounces+vincent.cui=[hidden email]] On Behalf Of Kieran Mansley
Sent: 2012年8月8日 16:53
To: Mailing list for lwIP users
Subject: Re: [lwip-users] change port for web server


On 8 Aug 2012, at 01:11, vincent cui wrote:

> How to know the socket is in TCP time-wait state ?

You can't.  Any socket that you have a file descriptor for is not in the time wait state.  If you find that you want to re-use a port on a new socket and can't because there is another socket in the time wait state you could consider using the SO_REUSEADDR socket option to allow you to re-use it immediately.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users