/// <summary> /// Sends the given message over the network to the client. /// </summary> void INetworkConnection.SendMessage(OutgoingMessage outgoingMessage) { this.parentServer.socket.SendTo(outgoingMessage.MessageData, outgoingMessage.Length, SocketFlags.None, this.clientEndPoint); Log <LogNetworkServer> .Data.SentBytes += outgoingMessage.Length; Log <LogNetworkServer> .Data.SentPackets++; }
/// <summary> /// Copies data from an outgoing message to this message (simulating its data arriving as an incoming message). /// </summary> public void CopyFrom(OutgoingMessage outgoingMessage) { this.Clear(); this.Length = outgoingMessage.Length; Array.Copy(outgoingMessage.MessageData, this.MessageData, this.Length); }
/// <summary> /// Sends the given message over the network to the other endpoint. /// </summary> public void SendMessage(OutgoingMessage outgoingMessage) { IncomingMessage nextIncomingMessage = this.pairedNetworkConnection.messageBuffer.GetMessageToAddToIncomingQueue(); nextIncomingMessage.CopyFrom(outgoingMessage); }