Rejecting connection attempts on socket



I've searched and searched, and I have a feeling the answer is "you can't", but I figured I'd ask here just in case I missed something.

I have a socket, I've bound it to a port, and entered a listening state. I have accepted several connections, and do not want to talk to any more clients until I am done with one of them.

Now, I want further connection attempts to receive ECONNREFUSED.

I do not want to accept the connection and immediately close it. I do not want to simply not call accept, and have the client hang around, waiting for the eventual ETIMEDOUT. I just want a simple "I'm too busy to talk to you, go away, ECONNREFUSED" error. (Actually, I'd settle for any error on the client side, as long as it was immediate.)

And, once I've finished with one of the clients I'm talking to, I want to be able to go back to accepting connections.

Windows' WSAAccept() API call has a callback function which allows me to say "reject this connection", but I don't see anything in POSIX to allow this.

Have I missed something, or is this really "sorry, you can't do that"?

Thank you.

--
Kenneth Brody
.



Relevant Pages

  • Re: Connecting Out of Process Servers via COM+
    ... connection, and in fact we can only use one connection because of the way ... years ago when I needed a number of clients to share a single serial ... it would create a Dispatcher-Object first and registers ... > This means, altough COM+ would allow parallel requests, the calls would be ...
    (microsoft.public.vb.com)
  • Re: Network desintegrating(?)
    ... 15 clients XP Pro SP2 ... I made a reservation for Noodserv in DHCP. ... I know PDC and BDC are NT 4 terms, TELSERV is the SBS box, NOODSERV ... Ethernet adapter Local Area Connection: ...
    (microsoft.public.windows.server.sbs)
  • Re: Connect to Small Business Server VPN
    ... Here is the results of an ipconfig /all from one of my clients: ... Ethernet adapter Internet Connection: ... "Cris Hanna " ... Actually the subnet is correct on a VPN ...
    (microsoft.public.windows.server.sbs)
  • RE: No internet for clients
    ... I understand that the internal clients ... Please rerun the CEICW to make sure your SBS 2003 server have right ... How to configure Internet access in Windows Small Business Server 2003 ... Two network adapters - manual router connection to broadband ...
    (microsoft.public.windows.server.sbs)
  • Re: How can I make the server to call back to client without being blocked by firewall.
    ... Since UDP can also be in connection mode even ... *no* inbound TCP ports will be open to client machines. ... > Most, however, are not so liberal, and by default restrict clients to ... > Sometimes, especially in more security conscious environments, you may ...
    (comp.security.firewalls)