public void FlushAndClose()
{
if (Active == false || _isSendShutdown)
return;
Volatile.Write(ref _isSendShutdown, true);
// Shutdown 시도
if (Interlocked.Increment(ref _sendCount) == 1)
{
try
{
_socket.Shutdown(SocketShutdown.Both);
_socket.Close();
}
catch (ObjectDisposedException)
{
}
}
else
{
_sendQueue.Enqueue(null);
}
}
}