On 5/22/2012 12:11 PM, Richard Kettlewell wrote:
> Kenneth Brody<
kenb...@spamcop.net> writes:
>> 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.