示例#1
0
 /// <summary>
 /// Send data to server.
 /// </summary>
 /// <param name="bytes">The byte array to be send</param>
 /// <param name="offset">The position in the data buffer at witch to begin sending.</param>
 /// <param name="length">The number of the bytes to be send.</param>
 public void SendData(byte[] bytes, int offset, int length)
 {
     if (fIsConnected)
     {
         fLastOutgoingPacket = new OutgoingTCPClientPacket(this, bytes, offset, length, fLastOutgoingPacket);
     }
     else
     {
         throw new ConnectorDisconnectedException(this);
     }
 }
 public ConnectorCannotSendPacketException(TCPConnector connector, OutgoingTCPClientPacket packet)
     : base("Connector is disconnected")
 {
     fConnector = connector;
     fPacket    = packet;
 }