private void AsyncEndSend(IAsyncResult iar)
{
rwLock.AcquireReaderLock(-1);
if (!shutdownFlag)
{
UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState;
try
{
int bytesSent = udpSocket.EndSendTo(iar);
// note that call to the abstract PacketSent() method - we are passing the number
// of bytes sent in a separate parameter, since we can't use buffer.DataLength which
// is the number of bytes to send (or bytes received depending upon whether this
// buffer was part of a send or a receive).
PacketSent(buffer, bytesSent);
}
catch (SocketException)
{
//Logger.Log(
// "A SocketException occurred in UDPServer.AsyncEndSend()",
// Helpers.LogLevel.Error, se);
}
}
Interlocked.Decrement(ref rwOperationCount);
rwLock.ReleaseReaderLock();
}