You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
515 B
31 lines
515 B
3 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using System.Threading.Tasks;
|
||
|
using System.Net;
|
||
|
using System.Net.Sockets;
|
||
|
|
||
|
namespace KnockKnock.Lib
|
||
|
{
|
||
|
internal class Upstream
|
||
|
{
|
||
|
IPAddress ip;
|
||
|
int port;
|
||
|
|
||
|
|
||
|
public Upstream(IPAddress ip, int port)
|
||
|
{
|
||
|
this.ip = ip;
|
||
|
this.port = port;
|
||
|
}
|
||
|
|
||
|
public Socket Connect()
|
||
|
{
|
||
|
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||
|
s.Connect(this.ip, this.port);
|
||
|
return s;
|
||
|
}
|
||
|
}
|
||
|
}
|