public void Send(Packet p, bool sync) { if (_Disposing && !Connection.Connected) return; byte[] buffer = p.GetBuffer(); CXMineServer.SendLogFile(BitConverter.ToString(buffer, 0, p.Length) + "\r\n"); Connection.Send(buffer, p.Length, SocketFlags.None); CXMineServer.SendLogFile("Sent\r\n\r\n"); //Thread.Sleep(1000); }
public void Send(Packet p) { if (_Disposing) return; SendQueue.Gram gram; byte[] buffer = p.GetBuffer(); lock (_SendQueue) gram = _SendQueue.Enqueue(buffer, p.Length); if(gram != null) { _SocketAsyncEventOnSend.SetBuffer(gram.Buffer, 0, gram.Length); CXMineServer.SendLogFile("Sending: " + BitConverter.ToString(buffer, 0, p.Length) + "\r\n\r\n"); Send_Start(p.Length); } CXMineServer.Server.Signal(); }