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);
                }
            }
        }
Example #2
0
 protected override void OnError(System.Net.Sockets.SocketError error)
 {
     lock (stateLocker)
     {
         currState = ServerSessionState.Error;
     }
 }
Example #3
0
        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;
 }
Example #5
0
 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));
 }
Example #6
0
 public void OnConnectionClosed(ITcpConnection connection, System.Net.Sockets.SocketError socketError)
 {
     _producer.StopBackgroundJobs();
 }
Example #7
0
 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));
 }