示例#1
0
 /// <summary>
 /// Transmit a packet to a remote host
 /// </summary>
 /// <param name="destination">The host to transmit to</param>
 /// <param name="buffer">The buffer to transmit</param>
 /// <param name="length">The length of the data to transfer</param>
 internal void Transmit(IPEndPoint destination, byte[] buffer, int length)
 {
     if (destination.AddressFamily == AddressFamily.InterNetwork)
     {
         Socket.Send(buffer, length, destination);
     }
     else if (destination.AddressFamily == AddressFamily.InterNetworkV6)
     {
         Socket6.Send(buffer, length, destination);
     }
     else
     {
         throw new NotImplementedException("Protocol not implemented");
     }
 }
示例#2
0
 /// <summary>
 /// Implementation of the IDisposable interface
 /// </summary>
 public void Dispose()
 {
     PeriodicTimer.Stop();
     Socket.Close();
     Socket6.Close();
 }