static void Main(string[] args) { loop = new IOLoop(); socket = new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try { ConnectionAccepted += ProgramConnectionAccepted; socket.Bind(new IPEndPoint(IPAddress.Any, 3677)); socket.Listen(5); Console.WriteLine("Listening..."); socket.BeginAccept(AcceptCallback, null); loop.Start(); } catch(Exception ex) { OnError(ex); } }
static void Main(string[] args) { loop = new IOLoop(); socket = new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try { ConnectionAccepted += ProgramConnectionAccepted; socket.Bind(new IPEndPoint(IPAddress.Any, 3677)); socket.Listen(5); Console.WriteLine("Listening..."); socket.BeginAccept(AcceptCallback, null); loop.Start(); } catch (Exception ex) { OnError(ex); } }
public Loop(IOLoop owner) { Owner = owner; }
public SocketStream(IOLoop loop, Socket socket) { Loop = loop; Socket = socket; }