lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Refusing an incoming connection on a listening port


From: Antonio de Angelis
Subject: Re: [lwip-users] Refusing an incoming connection on a listening port
Date: Wed, 20 Aug 2008 13:28:40 +0200
User-agent: Opera Mail/9.51 (Win32)

In data 20 agosto 2008 alle ore 13:12:07, Jonathan Larmour <address@hidden> ha scritto:

Antonio de Angelis wrote:
Hi all,
I am working with the Win32 port. My question is, when i create a listening server on a specific port, how can I refuse an incoming connection on that port? For example, if I want to refuse the connection from a specific remote IP address,

lwIP does not have the ability to selectively only establish certain TCP connections and not others. So you won't be able to selectively have "connection refused" sent to an unwanted remote IP.

But there's nothing stopping you immediately closing the connection as soon as a connection was accepted, after you've looked at who the peer address is. That's probably good enough.

or if i want to refuse the connection in case that there are too much active connections on the server. Thank you

That case is different - denying everybody, rather than denying selectively. In which case you could temporarily remove your listening socket entirely. However because lwIP doe snot have SOREUSEADDR, it's probably safer not to, otherwise you might have difficulty recreating the socket reliably when things are back to normal again. So again maybe it's still better to just close unwanted connections after they're accepted.

Jifl

Thank you for your answers!!! Bye

Antonio



--
Creato con il rivoluzionario client e-mail di Opera: http://www.opera.com/mail/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]