void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { try { bool PLCComm = false; bool CoderComm = false; bool RobotComm = false; IPEndPoint ClientIP = e.TcpClient.Client.RemoteEndPoint as IPEndPoint; if (ClientIP.Address.ToString() == Properties.Settings.Default.样件架PLC端) { clientPLC = e.TcpClient; PLCComm = true; } if (ClientIP.Address.ToString() == Properties.Settings.Default.拉力机PLC端) { clientCoder = e.TcpClient; CoderComm = true; } if (ClientIP.Address.ToString() == Properties.Settings.Default.Robot端) { clientRobot = e.TcpClient; RobotComm = true; } if (PLCComm && CoderComm && RobotComm) { LogRefresh(ipC.iPConfig[ClientIP.Address.ToString()] + e.TcpClient.Client.RemoteEndPoint.ToString() + " has connected.", null, dic["测试命令模式"]); BeginInvoke(new CheckStateControlDelegate(CheckStateControl), new Object[] { PlatformStatusClassifier.StatusClassifier(Params.ProcessName.Communication) }); } } catch (Exception ex) { log.Exception(ex); } }
private void ClientConnected(object sender, TcpClientConnectedEventArgs e) { var key = e.Session.RemoteEndPoint.ToString(); Sessions.AddOrUpdate(key, e.Session, (k, o) => o); Console.WriteLine($"客户端 {e.Session.RemoteEndPoint} 已连接 {e.Session}."); }
/// <summary> /// 建立客户端连接事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tcpServer_ClientConnected(object sender, TcpClientConnectedEventArgs e) { var remoteEndPoint = e.TcpClient.Client.RemoteEndPoint.ToString(); Dispatcher.BeginInvoke((Action) delegate { lbClient.Items.Add(remoteEndPoint); }); }
/// <summary> /// 连接成功后消息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { //加入到连接池中 Console.WriteLine("连接成功;key:" + e.Session.SessionKey); AllConnectionKey.Add(e.Session.SessionKey, e.Session); writeLogs("连接成功;key:" + e.Session.SessionKey); }
private void ClientConnect(object sender, TcpClientConnectedEventArgs e) { foreach (var item in server.Connections) { CommonModules.ControlSafeOPeration.CtrlSafeOperation.InvokeSafeOperation(listBox1, () => { listBox1.Items.Add(string.Format("{0}:{1}", item.Address[0], item.Port)); }); } }
public override void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { string str = string.Format("小车通信程序连接成功,", e.Session.RemoteEndPoint); Console.WriteLine(str); OnMessageEvent(this, new MessageEventArgs(str)); //string pathAgv = ConstString.AGV_PATH; //SendTo(e.Session.SessionKey, MessageType.AgvFile, pathAgv, false); }
private void OnClientConnected(object sender, TcpClientConnectedEventArgs e) { _log.InfoFormat("TCP client [{0}] has connected.", e.Session.RemoteEndPoint); _sessions.Add(e.Session.SessionKey, e.Session); if (Connected != null) { Connected(this, new ActorTransportConnectedEventArgs(e.Session.SessionKey)); } }
public override void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { string str = string.Format("TCP client {0} has connected.", e.Session.RemoteEndPoint); Console.WriteLine(str); Logs.Info(str); OnMessageEvent(this, new MessageEventArgs(str)); string pathAgv = ConstDefine.AGV_PATH; SendTo(e.Session.SessionKey, MessageType.AgvFile, pathAgv, false); //_server.SendTo() }
private void OnClientConnected(object sender, TcpClientConnectedEventArgs e) { _log.DebugFormat("TCP client [{0}] has connected.", e.Session.RemoteEndPoint); var session = new ActorTransportSession(e.Session); _sessions.Add(e.Session.SessionKey, session); if (TransportConnected != null) { TransportConnected(this, new ActorTransportSessionConnectedEventArgs(session)); } }
void OnClientConnected(object sender, TcpClientConnectedEventArgs e) { int count = server.SessionCount; if (count >= Settings.Default.MaxConnections) { throw new InvalidOperationException($"The maximum number of connections has been exceeded {count}."); } else { if (Settings.Default.DebugMode) { Log(string.Format("TCP client {0} has connected {1}.", e.Session.RemoteEndPoint, e.Session.LocalEndPoint)); } } }
public abstract void server_ClientConnected(object sender, TcpClientConnectedEventArgs e);
static void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Debug.Log(string.Format("TCP client {0} has connected.", e.TcpClient.Client.RemoteEndPoint.ToString())); }
private void _server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Console.WriteLine(string.Format("{0}ClientConnected", e.Session.SessionKey)); }
/// <summary> /// 客户端连接事件执行 /// </summary> /// <param name="sender"></param> /// <param name="e">客户端连接事件参数-Tcpclient</param> static void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Console.WriteLine("TCP client {0} has connected.", e.TcpClient.Client.RemoteEndPoint.ToString()); }
/// <summary> /// 显示当期某个客户端已连接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { LogHelper.showLog(txtLog, "主机:" + e.TcpClient.Client.RemoteEndPoint.ToString() + ",连接到服务器\r\n"); //LogHelper.WriteLog(DateTime.Now.ToString("HH:mm:ss") + ":" + e.TcpClient.Client.RemoteEndPoint.ToString() + ",连接到服务器\r\n"); }
private void OnClientConnected(object sender, TcpClientConnectedEventArgs args) { _clienTcpConnector = new TcpConnector(args.ClientSocket, new DefaultWireProtocol()); _clienTcpConnector.MessageReceived += OnMessageReceived; _clienTcpConnector.StartAsync(); }
private void TcpServer_ClientConnected(object sender, TcpClientConnectedEventArgs e) { context.Logger.WriteLog("{0}已连接!", e.TcpClient.Client.RemoteEndPoint); }
void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { this.BeginInvoke(new MethodInvoker(delegate { this.listBox1.Items.Add("Server Thread=" + Thread.CurrentThread.ManagedThreadId + " ==> Accept " + e.remoteEndPoint); this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1; })); //throw new NotImplementedException(); }
private void OnClientConnected(object sender, TcpClientConnectedEventArgs e) { _clients.AddOrUpdate(e.TcpClient.Client.RemoteEndPoint.ToString(), e.TcpClient, (n, o) => { return(e.TcpClient); }); }
private void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Logger($" {e.TcpClient.Client.RemoteEndPoint} Connect"); }
private static void Server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Console.WriteLine($"client [{e.TcpClient.Client.RemoteEndPoint.ToString()}] connected"); }
static void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Console.WriteLine(string.Format("TCP client {0} has connected {1}.", e.Session.RemoteEndPoint, e.Session)); }
/// <summary> /// 客户端连接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void server_OnClientConnected(object sender, TcpClientConnectedEventArgs e) { SocketListener s = sender as SocketListener; Console.WriteLine("{0:M} {1:t}:有新的连接,当前连接数{2},终结点:{3}", DateTime.Now, DateTime.Now, s.NumConnections, e.Uid); }
static void server_ClientConnected(object sender, TcpClientConnectedEventArgs e) { Logger.Debug(string.Format(CultureInfo.InvariantCulture, "TCP client {0} has connected.", e.TcpClient.Client.RemoteEndPoint.ToString())); }