Beispiel #1
0
        internal static void TryWriteStream(IntPtr handle, ref uv_buf_t buf)
        {
            Debug.Assert(handle != IntPtr.Zero);

            var bufs   = new [] { buf };
            int result = uv_try_write(handle, bufs, bufs.Length);

            ThrowIfError(result);
        }
Beispiel #2
0
        internal static void TryWriteStream(IntPtr handle, ref uv_buf_t buf)
        {
            Contract.Requires(handle != IntPtr.Zero);

            var bufs   = new [] { buf };
            int result = uv_try_write(handle, bufs, bufs.Length);

            if (result < 0)
            {
                throw CreateError((uv_err_code)result);
            }
        }
Beispiel #3
0
        internal static void UdpTrySend(IntPtr handle, IPEndPoint remoteEndPoint, ref uv_buf_t buf)
        {
            Debug.Assert(handle != IntPtr.Zero);
            Debug.Assert(remoteEndPoint != null);

            GetSocketAddress(remoteEndPoint, out sockaddr addr);

            var bufs   = new[] { buf };
            int result = uv_udp_try_send(handle, bufs, bufs.Length, ref addr);

            ThrowIfError(result);
        }
Beispiel #4
0
        internal static void UdpTrySend(IntPtr handle, IPEndPoint remoteEndPoint, ref uv_buf_t buf)
        {
            Contract.Requires(handle != IntPtr.Zero);
            Contract.Requires(remoteEndPoint != null);

            GetSocketAddress(remoteEndPoint, out sockaddr addr);

            var bufs   = new[] { buf };
            int result = uv_udp_try_send(handle, bufs, bufs.Length, ref addr);

            if (result < 0)
            {
                throw CreateError((uv_err_code)result);
            }
        }