A quick and dirty Windows Service to start and stop network services on-demand.
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.
 
 

30 lines
515 B

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;
}
}
}