ConnectAsync() public method

public ConnectAsync ( ) : void
return void
コード例 #1
1
ファイル: Program.cs プロジェクト: ThrDev/Socks5
 static void Main(string[] args)
 {
     Socks5Server x = new Socks5Server(IPAddress.Any, 1080);
     PluginLoader.ChangePluginStatus(false, typeof(Auth));
     x.Start();
     Socks5Client m = new Socks5Client("localhost", 1080, "portquiz.net", 65532);
     m.OnConnected += M_OnConnected;
     m.OnDataReceived += M_OnDataReceived;
     m.ConnectAsync();
     while (true)
     {
         /*Console.Clear();
         Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f));
         Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.BytesReceivedPerSec, x.Stats.BytesSentPerSec);*/
         Thread.Sleep(1000);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: tsebring/Socks5
 static void Main(string[] args)
 {
     Socks5Server x = new Socks5Server(IPAddress.Any, 1084);
     x.Start();
     PluginLoader.ChangePluginStatus(false, typeof(socks5.ExamplePlugins.DataHandlerExample));
     //enable plugin.
     /*foreach (object p in PluginLoader.GetPlugins)
     {
         if (p.GetType() == typeof(LoginHandlerExample))
         {
             //enable it.
             PluginLoader.ChangePluginStatus(true, p.GetType());
             Console.WriteLine("Enabled {0}.", p.GetType().ToString());
         }
     }*/
     //Start showing network stats.
     Socks5Client p = new Socks5Client("localhost", 1084, "your.ip.goes.here or domain", 9000, "yolo", "swag");
     p.OnConnected += p_OnConnected;
     p.ConnectAsync();
     while (true)
     {
         /*Console.Clear();
         Console.Write("Total Clients: \t{0}\nTotal Recvd: \t{1:0.00##}MB\nTotal Sent: \t{2:0.00##}MB\n", x.Stats.TotalClients, ((x.Stats.NetworkReceived / 1024f) / 1024f), ((x.Stats.NetworkSent / 1024f) / 1024f));
         Console.Write("Receiving/sec: \t{0}\nSending/sec: \t{1}", x.Stats.BytesReceivedPerSec, x.Stats.BytesSentPerSec);*/
         Thread.Sleep(1000);
     }
 }