protected override void Initialize() { this.service = this.Server as ForwardingService; this.agent = new TcpAgent(); this.agent.Endpoint = this.service.ForwardingEndPoint; this.agent.Received += Agent_Received; this.agent.Disconnected += Agent_Disconnected; }
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); }