示例#1
0
 static void OnTcpServerConnected(object sender, TcpServerConnectedEventArgs e)
 {
     Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "TCP server {0} has connected.", e.ToString()));
 }
示例#2
0
 void client_ServerConnected(object sender, TcpServerConnectedEventArgs e)
 {
     this.tbMsg.Invoke(new Action(() => {
         this.tbMsg.AppendText(string.Format(CultureInfo.InvariantCulture, "TCP server {0} has connected." + System.Environment.NewLine, e.ToString()));
     }));
 }
示例#3
0
 static void client_ServerConnected(object sender, TcpServerConnectedEventArgs e)
 {
     Logger.Debug(string.Format(CultureInfo.InvariantCulture, "TCP server {0} has connected.", e.ToString()));
 }
示例#4
0
 /// <summary>
 /// 已连接到服务器
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 static void ControllerServer_ServerConnected(
     object sender, TcpServerConnectedEventArgs e)
 {
     try
     {
         JsonInterFace.ClientIP   = ControllerServer.ClientIP;
         JsonInterFace.ClientPort = ControllerServer.ClientPort;
         JsonInterFace.Connected  = true;
         Parameters.PrintfLogsExtended(string.Format(CultureInfo.InvariantCulture,
                                                     "Tcp Client {0}:{1} To TCP server {2} has connected.", JsonInterFace.ClientIP, JsonInterFace.ClientPort.ToString(), e.ToString()));
     }
     catch (Exception Ex)
     {
         Parameters.PrintfLogsExtended(Ex.Message, Ex.StackTrace);
     }
 }