Beispiel #1
0
        public AsyncTCPServer(int port)
        {
            // Establish the local endpoint for the socket.
            // The DNS name of the computer
            // running the listener is "host.contoso.com".
            IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
            IPAddress   ipAddress  = ipHostInfo.AddressList[0];

            localEndPoint = new IPEndPoint(ipAddress, port);

            // Create a TCP/IP socket.
            listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            File.Delete("log.txt");

            log = new logging("");
            io  = new InputOutput(log);
        }
 public InputOutput(logging log)
 {
     this.log = log;
 }