I am trying to create a chat application with a non-blocking socket. for this I am supposed to use the poll() function. I understand that I've to include the "poll.h" header file but my compiler says "No such file or directory found",On the other hand If I don't include this file my code accepts the structure pollfd,it compiles fine but at run time gives me the error that the variable "P is used without being initialised"(I defined "P" to be a pollfd variable)
could some one tell me what should I do in this situation...
Is it possible to download header files?
I am working on visual studio 2008.
According to this forum post, you can try using select() instead of poll(), which Windows does not support. You could try to download the libraries and header files that you need, but those may in turn rely on platform-dependent libraries, bringing you back to square one.
You'll want to use the Windows implementation of select(), of course. Here's the link. The header is file is Winsock2.h.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With