예제 #1
0
        internal bool TransmitPackets(SafeCloseSocket socketHandle, IntPtr packetArray, int elementCount, int sendSize, SafeNativeOverlapped overlapped, TransmitFileOptions flags)
        {
            EnsureDynamicWinsockMethods();
            TransmitPacketsDelegate transmitPackets = _dynamicWinsockMethods.GetDelegate <TransmitPacketsDelegate>(socketHandle);

            return(transmitPackets(socketHandle, packetArray, elementCount, sendSize, overlapped, flags));
        }
예제 #2
0
        internal bool TransmitPackets(SafeCloseSocket socketHandle, IntPtr packetArray, int elementCount, int sendSize, SafeNativeOverlapped overlapped)
        {
            EnsureDynamicWinsockMethods();
            TransmitPacketsDelegate transmitPackets = _dynamicWinsockMethods.GetDelegate <TransmitPacketsDelegate>(socketHandle);

            // UseDefaultWorkerThread = 0.
            return(transmitPackets(socketHandle, packetArray, elementCount, sendSize, overlapped, 0));
        }
예제 #3
0
 private void EnsureTransmitPackets(SafeCloseSocket socketHandle)
 {
     if (this.transmitPackets == null)
     {
         lock (this.lockObject)
         {
             if (this.transmitPackets == null)
             {
                 Guid   guid = new Guid("{0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}");
                 IntPtr ptr  = this.LoadDynamicFunctionPointer(socketHandle, ref guid);
                 this.transmitPackets = (TransmitPacketsDelegate)Marshal.GetDelegateForFunctionPointer(ptr, typeof(TransmitPacketsDelegate));
             }
         }
     }
 }
 private void EnsureTransmitPackets(SafeCloseSocket socketHandle)
 {
     if (_transmitPackets == null)
     {
         lock (_lockObject)
         {
             if (_transmitPackets == null)
             {
                 Guid   guid = new Guid("{0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}");
                 IntPtr ptrTransmitPackets = LoadDynamicFunctionPointer(socketHandle, ref guid);
                 _transmitPackets = Marshal.GetDelegateForFunctionPointer <TransmitPacketsDelegate>(ptrTransmitPackets);
             }
         }
     }
 }