protected virtual void Sent(AsyncSocketSendEventArgs e) { AsyncSocketSendEventHandler handler = OnSend; if (handler != null) { handler(this, e); } }
/// <summary> /// 데이터 송신 처리 콜백 함수 /// </summary> /// <param name="ar"></param> private void OnSendCallBack(IAsyncResult ar) { try { Socket client = (Socket)ar.AsyncState; int bytesWritten = client.EndSend(ar); AsyncSocketSendEventArgs sev = new AsyncSocketSendEventArgs(this.id, bytesWritten); Sent(sev); } catch (System.Exception e) { AsyncSocketErrorEventArgs eev = new AsyncSocketErrorEventArgs(this.id, e); ErrorOccured(eev); } }