Ejemplo n.º 1
0
 public DataEventArgs(Client client, byte[] buffer, int count)
 {
     Client = client;
     Buffer = buffer;
     Count = count;
     Offset = 0;
 }
Ejemplo n.º 2
0
 public SocksTunnel(SocksClient p, SocksRequest req, int packetSize, int timeout)
 {
     RemoteClient = new Client(new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), PacketSize);
     Client = p;
     Req = req;
     PacketSize = packetSize;
     Timeout = timeout;
 }
Ejemplo n.º 3
0
 void AcceptClient(IAsyncResult res)
 {
     try
     {
         TcpListener px = (TcpListener)res.AsyncState;
         Socket x = px.EndAcceptSocket(res);
         Task.Set();
         Client f = new Client(x, PacketSize);
         f.onClientDisconnected += onClientDisconnected;
         onClientConnected(this, new ClientEventArgs(f));
     }
     catch(Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
  }
Ejemplo n.º 4
0
 public ClientEventArgs(Client client)
 {
     Client = client;
 }
Ejemplo n.º 5
0
 public SocksClient(Client cli)
 {
     Client = cli;
 }
Ejemplo n.º 6
0
 public static byte[] Receive(Client client)
 {
     byte[] buffer = new byte[2048];
     int received = client.Receive(buffer, 0, buffer.Length);
     if (received != -1)
     {
         return buffer;
     }
     else
         return null;
 }