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); } }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5