コード例 #1
0
        public ReconSocketServer(int ipport)
        {
            //int port = AppConfigReader.GetIntKeyValue("Port");
            //private string IPAddress = AppConfigReader.GetStringKeyValue("IPAddress");

            try
            {
	            RecSocketServer = new ReconnectingSocket();
	            RecSocketServer.Verbose = true;
	            RecSocketServer.InitServer(ipport, false);
	            RecSocketServer.OnConnection += new ReconnectingSocket.OnConnectionEvent(OnSocketServerConnection);
	            RecSocketServer.OnData += new ReconnectingSocket.OnDataEvent(OnServerSocketData);

                Debug.WriteLine("TCP server is listening on port: " + ipport);
            }
            catch (System.Exception ex)
            {
                Debug.WriteLine("TCP server establish error: " + ex);
            }

        }