Exemplo n.º 1
0
        public OscServer(int listenPort)
        {
            _messageHandler = new MessageHandler();

            _socket = new Socket(
                AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

            // On some platforms, it's not possible to cancel Receive() by
            // just calling Close() -- it'll block the thread forever!
            // Therefore, we heve to set timeout to break ServerLoop.
            _socket.ReceiveTimeout = 100;

            _socket.Bind(new IPEndPoint(IPAddress.Any, listenPort));
        }
Exemplo n.º 2
0
 public PacketParser(MessageHandler handler)
 {
     _messageHandler = handler;
 }