Example #1
0
        private void InitSocket()
        {
            this.udpRemote_ = new IPEndPoint(IPAddress.Broadcast, REMOTE_PORT);
            IPEndPoint ip = new IPEndPoint(IPAddress.Any, BIND_PORT);

            this.udp_ = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            this.udp_.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
            try
            {
                this.udp_.Bind(ip);
                SocketHelper.GetInstance().Register(this);
            } catch (SocketException e)
            {
            }
        }
Example #2
0
 public ISocket()
 {
     SocketHelper.GetInstance().recvHandle_ +=
         new SocketHelper.RecvSignalHandle(RecvSignaled);
 }