[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Refusing an incoming connection on a listening port
From: |
Jonathan Larmour |
Subject: |
Re: [lwip-users] Refusing an incoming connection on a listening port |
Date: |
Wed, 20 Aug 2008 12:12:07 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515) |
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
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------ Opinions==mine