void OnMyConnected(Connection connection, System.Net.Sockets.SocketError result) { if (result == System.Net.Sockets.SocketError.Success) { LoginReq request = new LoginReq(); request.account = account; request.pass = pass; request.randomSeed = guid; request.deviceInfo = deviceInfo; //if (MessageStatistic.isOpen) loginReq.seq = MessageStatistic.curTimeMS(); if (clientCore.Transmitter.SendToAuth(connection, request, (int)EGMI.EGMI_LOGIN_REQ) == false) { if (clientCore != null && clientCore.onLogin != null) { clientCore.onLogin((int)EGEC.EGEC_CORE_NET_ERROR, 1, "", -1, null); } } } else { if (clientCore != null && clientCore.onLogin != null) { clientCore.onLogin((int)EGEC.EGEC_CORE_NET_ERROR, 1, "", -1, null); } } }
protected override void OnError(System.Net.Sockets.SocketError error) { lock (stateLocker) { currState = ServerSessionState.Error; } }
Sockets.SocketError Send(byte[] buffer, int offset, int size, Sockets.SocketFlags socketFlags = Sockets.SocketFlags.None) { Sockets.SocketError result = Sockets.SocketError.Success; int bytesSent = 0; while (bytesSent < size && result == Sockets.SocketError.Success) { bytesSent += socket.Send(buffer, offset + bytesSent, size - bytesSent, socketFlags, out result); } if (result == Sockets.SocketError.Success && bytesSent < size) { throw new System.IO.IOException("Сообщение отправлено не полностью"); } return(result); }
public TcpTransportResult(SocketAsyncOperation operation, SocketError error) { Operation = operation; Error = error; }
public int Send(byte[] arr, int offset, int size, ns.SocketFlags f, out ns.SocketError er) { return(realSocket.Send(arr, offset, size, f, out er)); }
public void OnConnectionClosed(ITcpConnection connection, System.Net.Sockets.SocketError socketError) { _producer.StopBackgroundJobs(); }
public int Receive(byte[] arr, int offset, int size, ns.SocketFlags f, out ns.SocketError er) { return(realsocket.Receive(arr, offset, size, f, out er)); }