July 2017
Beginner to intermediate
390 pages
10h 53m
English
In the code sample where we used the server, we set up a TcpClient instance to do the network things. This time, we will do something else. In the SetHolographicSpace method, call the method we are about write:
SetupDatagramServer();
Also call the implementation:
void SetupDatagramServer()
{
_serverSocket = new DatagramSocket();
_serverSocket.MessageReceived += MessageReceived;
var bindAwaiter = _serverSocket.BindServiceNameAsync("8000");
var connectionCompletedHandler = new AsyncActionCompletedHandler(OnConnectionCompleted);
bindAwaiter.Completed = connectionCompletedHandler;
}
This time we use a DatagramSocket. This is a UDP-based connection. The difference between TCP and UDP is mainly that UDP is a ...
Read now
Unlock full access