private void DataSent(IAsyncResult res)
{
try
{
int sent = ((Socket)res.AsyncState).EndSend(res);
if (sent < 0)
{
this.Sock.Shutdown(SocketShutdown.Both);
this.Sock.Close();
return;
}
DataEventArgs data = new DataEventArgs(this, new byte[0] {}, sent);
this.onDataSent(this, data);
}
catch (Exception ex) {
#if DEBUG
Console.WriteLine(ex.ToString());
#endif
}
}