Example #1
0
 public void OnSockMgrAccept(object sender, SockMgrAcceptEventArgs e)
 {
     // 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()));
 }
Example #2
0
 // event handlers
 private void OnSockMgrAccept(object sender, SockMgrAcceptEventArgs e)
 {
     RegisterNewSockMgr(e.Handler);
     SockMgrAcceptEvent?.Invoke(sender, e);
 }
Example #3
0
 // return
 private void OnSocketAccept(object sender, SockMgrAcceptEventArgs e)
 {
     SockMgrAcceptEvent?.Invoke(sender, e);
 }