public override void Update(float delta) { m_roundTripView.SetText("Round trip: " + m_connection.AverageRoundtripTime); m_remoteTimeOffsetView.SetText("Remote time offset: " + m_connection.RemoteTimeOffset); NetConnectionStatistics stats = m_connection.Statistics; m_sentPacketsView.SetText("Sent packet: " + stats.SentPackets); m_receivedPacketsView.SetText("Received packet: " + stats.ReceivedPackets); m_sentBytesView.SetText("Sent bytes: " + stats.SentBytes); m_receivedBytesView.SetText("Received bytes: " + stats.ReceivedBytes); }
internal NetConnection(NetPeer peer, NetEndPoint remoteEndPoint) { m_peer = peer; m_peerConfiguration = m_peer.Configuration; m_status = NetConnectionStatus.None; m_outputtedStatus = NetConnectionStatus.None; m_visibleStatus = NetConnectionStatus.None; m_remoteEndPoint = remoteEndPoint; m_sendChannels = new NetSenderChannelBase[NetConstants.NumTotalChannels]; m_receiveChannels = new NetReceiverChannelBase[NetConstants.NumTotalChannels]; m_queuedOutgoingAcks = new NetQueue <NetTuple <NetMessageType, int> >(4); m_queuedIncomingAcks = new NetQueue <NetTuple <NetMessageType, int> >(4); m_statistics = new NetConnectionStatistics(this); m_averageRoundtripTime = -1.0f; m_currentMTU = m_peerConfiguration.MaximumTransmissionUnit; }
internal NetworkStatistics(NetConnection connection) { _statistics = connection.Statistics; }
internal NetConnection(NetPeer peer, IPEndPoint remoteEndPoint) { m_peer = peer; m_peerConfiguration = m_peer.Configuration; m_status = NetConnectionStatus.None; m_visibleStatus = NetConnectionStatus.None; m_remoteEndPoint = remoteEndPoint; m_sendChannels = new NetSenderChannelBase[NetConstants.NumTotalChannels]; m_receiveChannels = new NetReceiverChannelBase[NetConstants.NumTotalChannels]; m_queuedOutgoingAcks = new NetQueue<NetTuple<NetMessageType, int>>(4); m_queuedIncomingAcks = new NetQueue<NetTuple<NetMessageType, int>>(4); m_statistics = new NetConnectionStatistics(this); m_averageRoundtripTime = -1.0f; m_currentMTU = m_peerConfiguration.MaximumTransmissionUnit; }