public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Use poll with Windows socket
@ 2019-08-07 21:09 Biswapriyo Nath
  2019-08-08  8:25 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Biswapriyo Nath @ 2019-08-07 21:09 UTC (permalink / raw)
  To: cygwin

I've tried to use poll() with a Windows socket (from WSASocket) and a
cygwin side file descriptor (fd). But it is only signaled for fd only.

At first, I have seen that fhandler_socket_wsock::set_socket_handle() casts
SOCKET to int. So, is it possible to use poll() with the SOCKET type? Or Is
there any magic to convert Windows socket to cygwin fd and vice-versa?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Use poll with Windows socket
  2019-08-07 21:09 Use poll with Windows socket Biswapriyo Nath
@ 2019-08-08  8:25 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2019-08-08  8:25 UTC (permalink / raw)
  To: Biswapriyo Nath; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

On Aug  8 02:39, Biswapriyo Nath wrote:
> I've tried to use poll() with a Windows socket (from WSASocket) and a
> cygwin side file descriptor (fd). But it is only signaled for fd only.
> 
> At first, I have seen that fhandler_socket_wsock::set_socket_handle() casts
> SOCKET to int. So, is it possible to use poll() with the SOCKET type? Or Is
> there any magic to convert Windows socket to cygwin fd and vice-versa?

No, you can't do that.  The Cygwin poll call requires a Cygwin socket,
otherwise all the bookkeeping stuff fails.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-08  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 21:09 Use poll with Windows socket Biswapriyo Nath
2019-08-08  8:25 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).