internal override void ReConnect(ClientConnect pConnection) { if (!this.Disposed) { SocketConnector pConnector = (SocketConnector)pConnection.CurrentCreator; pConnector.ReConnect(true, null, null); } }
public SocketConnector AddConnector(IPEndPoint pEndPoint) { SocketConnector pConnector = null; if (!this.Disposed) { pConnector = new SocketConnector(this, pEndPoint, 0, 0); this.AddCreator(pConnector); } return(pConnector); }
internal void ConnectCallback(IAsyncResult ar) { if (!this.Disposed) { ConnectionManage pConnection = null; SocketConnector pConnector = null; try { pConnector = (SocketConnector)ar.AsyncState; pConnection = new ClientConnect(pConnector.CurrentSocket, this, this.Service); pConnector.CurrentSocket.EndConnect(ar); pConnector.CurrentSocket.ReceiveBufferSize = this.Service.SocketBufferSize; pConnector.CurrentSocket.SendBufferSize = this.Service.SocketBufferSize; pConnection.Active = true; this.Service.AddConnection(pConnection); this.Initialize(pConnection); } catch (Exception ex) { if (ex is SocketException) { this.iCurrentCount++; this.ReConnect(false, pConnection, ex); } else { this.Service.SocketExceptionEvent(pConnection, ex); } } } }