Ejemplo n.º 1
0
 private void HandleNewExternalSocket(Socket socket)
 {
     Console.WriteLine($"New external socket from {socket.RemoteEndPoint}");
     if (MainSocket?.IsConnected ?? false)
     {
         var channel = CreateNewChannel(socket);
         try
         {
             MainSocket.S2C_StartNewConnection(channel.ChannelId, Mapping.TargetPort, Mapping.InternalPort);
         }
         catch (Exception ex)
         {
             socket.Close();
             channel.Close(ex);
         }
     }
 }