コード例 #1
0
ファイル: ClientInternal.cs プロジェクト: m9ra/Hipiol
        internal ClientInternal(NetworkManager manager, int clientIndex)
        {
            Client = new Client(clientIndex, 0);

            ReceiveEventArgs.Completed += (o,e) => manager.Callback_Receive(this);
            SendEventArgs.Completed += (o, e) => manager.Callback_DataSent(this);
        }
コード例 #2
0
ファイル: NetworkManager.cs プロジェクト: m9ra/Hipiol
        /// <summary>
        /// Gets <see cref="ClientInternal"/> that is identified by given client.
        /// </summary>
        /// <param name="client">Client which identifiest the <see cref="ClientInternal"/></param>
        /// <returns>The <see cref="ClientInternal"/>.</returns>
        internal ClientInternal GetClientInternal(Client client)
        {
            var clientInternal = _clientSlots[client.Index];
            if (clientInternal.Client.Key != client.Key)
                //client is not available yet
                return null;

            return clientInternal;
        }
コード例 #3
0
ファイル: IOPool.cs プロジェクト: m9ra/Hipiol
 /// <summary>
 /// Fires event that handles client sending.
 /// </summary>
 /// <param name="client">Client whom the data will be sent.</param>
 /// <param name="block">The data to send.</param>
 /// <param name="dataOffset">Offset where data in block starts.</param>
 /// <param name="dataSize">Size of data to send.</param>
 private void Fire_Send(Client client, Block block, int dataOffset, int dataSize)
 {
     var evt = _dataSendEvents.GetEvent();
     evt.Client = client;
     evt.Block = block;
     evt.DataOffset = dataOffset;
     evt.DataSize = dataSize;
     _iochannel.EnqueueEvent(evt);
 }
コード例 #4
0
ファイル: IOPool.cs プロジェクト: m9ra/Hipiol
 /// <summary>
 /// Sends given block to given client.
 /// </summary>
 /// <param name="client">Client whom the data will be sent.</param>
 /// <param name="block">Block that will be sent.</param>
 /// <param name="dataOffset">Offset where data in block starts.</param>
 /// <param name="dataSize">Size of data to send.</param>
 public void Send(Client client, Block block, int dataOffset, int dataSize)
 {
     Fire_Send(client, block, dataOffset, dataSize);
 }
コード例 #5
0
ファイル: IOPool.cs プロジェクト: m9ra/Hipiol
 /// <summary>
 /// Disconnects given client from the current pool.
 /// </summary>
 /// <param name="client">Client which will be disconnected.</param>
 public void Disconnect(Client client)
 {
     throw new NotImplementedException();
 }