示例#1
0
        public Output(Network.Log log, int port)
        {
            this.myLog = log;
            nodes      = new Dictionary <int, Socket>();
            try
            {
                serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, port);

                serverSocket.Bind(ipEndPoint);
                serverSocket.Listen(StaticInfo.MAXNODES);
                serverSocket.BeginAccept(new AsyncCallback(OnAccept), null);

                myLog.Queue.Enqueue("Output is working = " + port);
            }
            catch (Exception) { }
        }