internal async Task SendInternalAsync(NetworkPacket networkPacket) { // Serialize byte[] packet = _messageSerializer.SerializeNetworkMessage(networkPacket); // Wrap for network packet = _packetFormatter.PreparePacketForNetwork(packet); // Send await _socket.SendAsync(new ArraySegment <byte>(packet), SocketFlags.None); }