int EndSend(IAsyncResult ar, out Exception error) { error = null; try { return(socket.EndSend(ar)); } catch (Exception e) { error = e; return(-1); } }