public void ReverseServerToServer(ReverseAsyncSocket reverseServer, AsyncSocket server) { var id = 0; reverseServer.Connect(reverseSocket => server.Connect(socket => { var tid = id++; reverseSocket.Read((sid, command, buffer) => { if (sid == tid) { socket.Write(buffer); } }); socket.Read((buffer, count) => reverseSocket.Write(tid, Command.Data, buffer, 0, count)); })); }
public void ConnectReverse(string host, int port) { ReverseClient = new ReverseAsyncSocket(); ReverseClientToClient(ReverseClient, Client.Key, Client.Value); ReverseClient.Connect(host, port); }