Example #1
0
 public Service()
 {
     this.OnPrepareListen += new TcpServerEvent.OnPrepareListenEventHandler(Service_OnPrepareListen);
     this.OnAccept        += new TcpServerEvent.OnAcceptEventHandler(Service_OnAccept);
     this.OnReceive       += new TcpServerEvent.OnReceiveEventHandler(Service_OnReceive);
     this.OnClose         += new TcpServerEvent.OnCloseEventHandler(Service_OnClose);
     agent = new TcpAgent();
     agent.Start("0.0.0.0", false);
     agent.OnReceive += new TcpAgentEvent.OnReceiveEventHandler(agent_OnReceive);
     agent.OnClose   += new TcpAgentEvent.OnCloseEventHandler(agent_OnClose);
 }
Example #2
0
 public Service()
 {
     remoteIp        = ConfigurationManager.AppSettings["RemoteIP"];
     remotePort      = ushort.Parse(ConfigurationManager.AppSettings["RemotePort"]);
     this.OnAccept  += new TcpServerEvent.OnAcceptEventHandler(Service_OnAccept);
     this.OnReceive += new TcpServerEvent.OnReceiveEventHandler(Service_OnReceive);
     this.OnClose   += new TcpServerEvent.OnCloseEventHandler(Service_OnClose);
     agent           = new TcpAgent();
     agent.Start("0.0.0.0", false);
     agent.OnReceive += new TcpAgentEvent.OnReceiveEventHandler(agent_OnReceive);
     agent.OnClose   += new TcpAgentEvent.OnCloseEventHandler(agent_OnClose);
 }