Torna al Thread
private void StartUpSocket()
{
try
{
string portStr = "1234";
int port = System.Convert.ToInt32(portStr);
IPAddress ipAdd = IPAddress.Parse("127.0.0.1");
// Create the listening socket...
m_mainSocket = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
IPEndPoint ipLocal = new IPEndPoint(ipAdd, port);
// Bind to local IP Address...
m_mainSocket.Bind(ipLocal);
// Start listening...
m_mainSocket.Listen(7);
}
catch (SocketException se)
{
MessageBox.Show(se.Message);
}
}