/// <summary>异步发送数据 /// </summary> /// <param name="socket">The socket.</param> /// <param name="outPacket">The out packet.</param> protected virtual void BeginSendData(ProxySocket socket, OutPacket outPacket) { try { ByteBuffer sendBuf = new ByteBuffer(); FillBytebuf(outPacket, sendBuf); socket.BeginSend(sendBuf.ToByteArray(), 0, sendBuf.Length, SocketFlags.None, new AsyncCallback(EndSendData), outPacket); } catch (Exception e) { policy.OnNetworkError(e); } }