Esempio n. 1
0
 public void OnSockMgrAccept(object sender, SockMgrAcceptEventArgs e)
 {
     _sockController.AddSockMgr(e.Handler, SocketRole.Client);
     // print: [Accept] local -> remote
     Console.WriteLine(string.Format("[Accept] {0} -> {1}",
                                     e.Handler.GetSockBase().GetSocket().LocalEndPoint.ToString(),
                                     e.Handler.GetSockBase().GetSocket().RemoteEndPoint.ToString()));
     Console.Write("> ");
     // send connection info to peer
     e.Handler.SendText(string.Format("{0} -> {1}",
                                      e.Handler.GetSockBase().GetSocket().LocalEndPoint.ToString(),
                                      e.Handler.GetSockBase().GetSocket().RemoteEndPoint.ToString()));
 }
Esempio n. 2
0
 // return
 private void OnSocketAccept(object sender, SockMgrAcceptEventArgs e)
 {
     SockMgrAcceptEvent?.Invoke(sender, e);
 }
Esempio n. 3
0
 // event handlers
 private void OnSockMgrAccept(object sender, SockMgrAcceptEventArgs e)
 {
     RegisterNewSockMgr(e.Handler);
     SockMgrAcceptEvent?.Invoke(sender, e);
 }