Here is what I have now:
Socket myNewSocket = currentSocket.Accept();
Here is what I want:
Socket myNewSocket = AcceptWithTimeout(currentSocket, timeoutInMilliseconds)
You could do a BeginAccept
and then have a timer that closes the socket to cancel the accept operation. Usually, though, servers just keep an asynchronous accept operation going constantly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.