/// <summary> /// Gets the current address to which the handle is bound. /// </summary> /// <returns></returns> public IPEndPoint GetPeerEndPoint() { this.EnsureCallingThread(); SockAddr socketAddress; #if DOTNET_CORE int namelen = Marshal.SizeOf <SockAddr>(); #else int namelen = Marshal.SizeOf(typeof(SockAddr)); #endif Libuv.EnsureSuccess(Libuv.uv_tcp_getpeername(this, out socketAddress, ref namelen)); return(socketAddress.ToIpEndPoint()); }