Exemplo n.º 1
0
        public static int SendBytes(IntPtr socket, byte[] buffer, int offset, int byteCount, int flags)
        {
            Debug.Assert(byteCount > 0);
            Debug.WriteLine("Sending " + byteCount + " bytes");
            int ret;
            var bufferHandle = Microsoft.Phone.InteropServices.GCHandle.Alloc(buffer, GCHandleType.Pinned);

            m_netSocketInterface.SendBytes(socket, new IntPtr(bufferHandle.AddrOfPinnedObject().ToInt32() + offset), byteCount, flags, out ret);
            Debug.WriteLine("Sent -> " + ret + " bytes");
            bufferHandle.Free();

            return(ret);
        }