Beispiel #1
0
        public IAsyncResult BeginReceiveFrom(byte[] buffer, int size, SocketFlags flags, ref EndPoint ep, AsyncCallback callback, object state)
        {
            CallbackState callbackState = new CallbackState();

            callbackState.buffer = buffer;
            callbackState.size   = size;
            callbackState.state  = state;
            return(this._socket.BeginReceiveFrom(buffer, 0, size, flags, ref ep, callback, callbackState));
        }
Beispiel #2
0
        public int BeginSend(byte[] buffer, int size, SocketFlags flags, AsyncCallback callback, object state)
        {
            CallbackState callbackState = new CallbackState();

            callbackState.size  = size;
            callbackState.state = state;
            this._socket.BeginSend(buffer, 0, size, SocketFlags.None, callback, callbackState);
            return(size);
        }