ACR_ServerCommunicator.SocketIo.OnDatagramReceive C# (CSharp) Method

OnDatagramReceive() private static method

This routine handles ALFA datagram protocol messages that have been received over the network.
private static OnDatagramReceive ( IntPtr buf, int len, sockaddr_in Sender ) : void
buf System.IntPtr Supplies the received data payload.
len int Supplies the length of received data.
Sender sockaddr_in Supplies the sender's address.
return void
        private static void OnDatagramReceive(IntPtr buf, int len, sockaddr_in Sender)
        {
            IPAddress Address = new IPAddress(Sender.sin_addr);
            int Port = (int)IPAddress.NetworkToHostOrder((short)Sender.sin_port);
            ServerNetworkManager NetworkManager = ACR_ServerCommunicator.GetNetworkManager();
            byte[] Data = new byte[len];
            Marshal.Copy(buf, Data, 0, len);

            NetworkManager.OnDatagramReceive(Data, Address, Port);
        }