示例#1
0
        public void TcpConnect(Tcp client, string ip, int port, Action callback)
        {
            this._callback = callback;
            NativeSocketAddress address = NativeSocketAddress.GetIPv4(ip, port);

            NativeMethods.uv_tcp_connect(this, client, ref address, ConnectRequest.connectCallback);
        }
示例#2
0
        public Udp Bind(string ip, int port, UdpFlags flags)
        {
            NativeSocketAddress address = NativeSocketAddress.GetIPv4(ip, port);

            NativeMethods.uv_udp_bind(this, ref address, flags);
            return(this);
        }
示例#3
0
 unsafe internal static extern int uv_udp_send(
     UdpRequest request,
     Udp udp,
     Structs.Buffer *buffers,
     int nbufs,
     ref NativeSocketAddress address,
     uv_udp_send_cb callback);
示例#4
0
        unsafe public void Send(Udp udp, string ip, int port, ArraySegment <ArraySegment <byte> > buffers, Action sended)
        {
            this._callback = sended;

            this.FillngBuffers(buffers);
            NativeSocketAddress address = NativeSocketAddress.GetIPv4(ip, port);

            NativeMethods.uv_udp_send(
                this,
                udp,
                (Structs.Buffer *) this._buffersPointer,
                buffers.Count,
                ref address,
                UdpRequest._udpSendCallback
                );
        }
示例#5
0
 public static extern int uv_ip6_addr(string ip, int port, out NativeSocketAddress addr);
示例#6
0
 internal static extern int uv_tcp_connect(ConnectRequest connectRequest, Tcp client, ref NativeSocketAddress address, uv_connect_cb connectCallback);
示例#7
0
 internal static extern int uv_udp_getsockname(Udp handle, out NativeSocketAddress address, ref int length);
示例#8
0
 internal static extern int uv_udp_bind(Udp handle, ref NativeSocketAddress address, UdpFlags flags);