Exemplo n.º 1
0
        public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, AsyncCallback callback, object state)
        {
            AsyncSendRegistration asyncRegistration = new AsyncSendRegistration(this, buffer, offset, size, socketFlags, callback, state);

            IntPtr pointer = GCHandle.ToIntPtr(GCHandle.Alloc(asyncRegistration));

            if (UDT_ERROR == API_BeginSend(_handle, buffer, size, (int)socketFlags, pointer))
            {
                throw new UDTSocketException();
            }

            // HACK !!!!!
            _processor.AddCommand(asyncRegistration);

            return(null);
        }
Exemplo n.º 2
0
		public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, AsyncCallback callback, object state)
		{
			AsyncSendRegistration asyncRegistration = new AsyncSendRegistration(this, buffer, offset, size, socketFlags, callback, state);

			IntPtr pointer = GCHandle.ToIntPtr(GCHandle.Alloc(asyncRegistration));

			if (UDT_ERROR == API_BeginSend(_handle, buffer, size, (int)socketFlags, pointer))
				throw new UDTSocketException();

			// HACK !!!!!
			_processor.AddCommand(asyncRegistration);

			return null;
		}
Exemplo n.º 3
0
        private static void UDTEndSendCallback(IntPtr pointer)
        {
            AsyncSendRegistration asyncRegistration = (AsyncSendRegistration)GCHandle.FromIntPtr(pointer).Target;

            _processor.AddCommand(asyncRegistration);
        }