public Gate() { frontendNetwork = new ServerNetwork(6888) { OnClientConnected = OnFrontendConnected, OnClientMessageReceived = OnFrontendMessageReceived, }; backendNetwork = new ServerNetwork(6999) { OnClientConnected = OnBackendConnected, OnClientMessageReceived = OnBackendMessageReceived, }; frontendNetwork.BeginAccept(); backendNetwork.BeginAccept(); }
public Gate(int frontPort, int backPort) { frontendNetwork = new ServerNetwork(frontPort) { OnClientConnected = OnFrontendConnected, OnClientDisconnected = OnFrontendDisconnected, OnClientMessageReceived = OnFrontendMessageReceived, }; backendNetwork = new ServerNetwork(backPort) { OnClientConnected = OnBackendConnected, OnClientDisconnected = OnBackendDisconnected, OnClientMessageReceived = OnBackendMessageReceived, }; frontendNetwork.BeginAccept(); backendNetwork.BeginAccept(); }