Example #1
0
 /// <summary>
 /// Abortively closes the socket. Once this method is called, no operations will complete.
 /// </summary>
 /// <remarks>
 /// <para>This method provides the fastest way to reclaim socket resources; however, its use is not generally recommended; <see cref="Close(IAsyncTcpConnection)"/> should usually be used instead of this method.</para>
 /// </remarks>
 public static void AbortiveClose(this IAsyncTcpConnection connection)
 {
     connection.LingerState = new LingerOption(true, 0);
     connection.Dispose();
 }
Example #2
0
 /// <summary>
 /// Gracefully or abortively closes the socket. Once this method is called, no operations will complete.
 /// </summary>
 /// <remarks>
 /// <para>This method performs a graceful shutdown of the underlying socket; however, this is performed in the background, so the application never receives notification of its completion. <see cref="IAsyncTcpConnection.ShutdownAsync"/> performs a graceful shutdown with completion.</para>
 /// <para>Note that exiting the process after calling this method but before the background shutdown completes will result in an abortive close.</para>
 /// <para><see cref="IAsyncTcpConnection.LingerState"/> will determine whether this method will perform a graceful or abortive close.</para>
 /// </remarks>
 public static void Close(this IAsyncTcpConnection connection)
 {
     connection.Dispose();
 }