Exemple #1
0
 /// <summary>
 /// Returns string representation of current packet.
 /// </summary>
 /// <returns>String representation of current packet.</returns>
 public override string ToString()
 {
     //System.Text.StringBuilder sb = new System.Text.StringBuilder();
     //sb.AppendLine("Packet dump:");
     //sb.AppendFormat("1s op: {0}{2}2d op: {1}{2}", FirstOpcode, SecondOpcode, Environment.NewLine);
     //sb.Append(L2Buffer.ToString(m_Buffer));
     //return sb.ToString();
     return(L2Buffer.ToString(_mBuffer));
 }
Exemple #2
0
        /// <summary>
        /// Sends buffer to client socket.
        /// </summary>
        /// <param name="buffer">Buffer to send.</param>
        public virtual void SendData(byte[] buffer)
        {
//#if DEBUG_NET_CLIENT
            Console.WriteLine("Sending:\r\n{0}", L2Buffer.ToString(buffer));
//#endif
            if (m_Socket != null && m_Socket.Connected)
            {
                lock (m_Lock)
                    m_SendQueue.Enqueue(buffer);

                if (m_SendReadyFlag)
                {
                    SendCallback(null);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Sends buffer to client socket.
        /// </summary>
        /// <param name="buffer">Buffer to send.</param>
        public virtual void SendData(byte[] buffer)
        {
            //#if DEBUG_NET_CLIENT
            Log.Info($"Sending:\r\n{L2Buffer.ToString(buffer)}");
            //#endif
            if ((MSocket == null) || !MSocket.Connected)
            {
                return;
            }

            lock (MLock)
                MSendQueue.Enqueue(buffer);

            if (MSendReadyFlag)
            {
                SendCallback(null);
            }
        }