CurlSharp.NativeMethods.select C# (CSharp) Method

select() private method

private select ( int nfds, [ readfds, [ writefds, [ exceptfds, timeval &timeout ) : int
nfds int
readfds [
writefds [
exceptfds [
timeout timeval
return int
		internal static extern int select (
			int nfds, // number of sockets, (ignored in winsock)
			[In, Out] ref fd_set readfds, // read sockets to watch
			[In, Out] ref fd_set writefds, // write sockets to watch
			[In, Out] ref fd_set exceptfds, // error sockets to watch
			ref timeval timeout);

Usage Example

Esempio n. 1
0
        /// <summary>
        ///     Call <c>select()</c> on the CurlEasy objects.
        /// </summary>
        /// <param name="timeoutMillis">
        ///     The timeout for the internal <c>select()</c> call,
        ///     in milliseconds.
        /// </param>
        /// <returns>
        ///     Number or <see cref="CurlEasy" /> objects with pending reads.
        /// </returns>
        /// <exception cref="System.NullReferenceException">
        ///     This is thrown if the native <c>CurlMulti</c> handle wasn't
        ///     created successfully.
        /// </exception>
        public int Select(int timeoutMillis)
        {
            ensureHandle();
#if USE_LIBCURLSHIM
            return(NativeMethods.curl_shim_select(_maxFd + 1, _fdSets, timeoutMillis));
#else
            var timeout = NativeMethods.timeval.Create(timeoutMillis);
            return(NativeMethods.select(_maxFd + 1, ref _fd_read, ref _fd_write, ref _fd_except, ref timeout));

            //return NativeMethods.select2(_maxFd + 1, _fd_read, _fd_write, _fd_except, timeout);
#endif
        }