// Create proxy erver socket
using ( this.m_proxySocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream,ProtocolType.Tcp) )
{
this.m_proxySocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 5000);
// call the Listen method to listen for and queue incoming connection requests.
this.m_proxySocket.Bind( new IPEndPoint(GetHostIP(), this.m_port) );
this.m_proxySocket.Listen( this.m_port );
// Display start message
Console.WriteLine("ProxyServer started at port " + this.m_port);
Console.WriteLine("ProxyServer ready for accepting incoming connections...");
Server = new IPEndPoint(Dns.Resolve(Dns.GetHostName()).AddressList[0],Int32.Parse(port.Text));
Sock = new Socket(Server.AddressFamily,SocketType.Stream,ProtocolType.Tcp);
Sock.Bind(Server);
Sock.Listen(10);