Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For code which uses the Berkley Sockets API (specified by POSIX, and available on Windows too) to communicate with other processes using a network protocol.
7
votes
Performant C# Socket server
= await this.tcpListener.AcceptSocketAsync();
if (socket == null)
{
break;
}
var client = new Client(socket, this.ClientDisconnected); … TextReader streamReader;
public Client(Socket socket, ClientDisconnectedDelegate doDisconnect)
{
this.socket = socket;
this.doDisconnect = doDisconnect;
Task.Factory.StartNew …
9
votes
Accepted
TCP async socket server client communication
state : null;
}
/* Checks if the socket is connected. */
public bool IsConnected(int id)
{
var state = this.GetClient(id);
return ! … (state.Listener.Poll(1000, SelectMode.SelectRead) && state.Listener.Available == 0);
}
/* Add a socket to the clients dictionary. Lock clients temporary to handle multiple access. …