T.T.T.
T.T.T.

Reputation: 34623

How do I call Poll() with this SOCKET?

SOCKET server = socket(PF_INET,SOCK_STREAM, 0);  
bind(server, 7.7.7.7, sizeof(7.7.7.7) );  
listen(server, 0);


server.Poll(1, SelectMode.SelectRead);

error C2228: left of '.Poll' must have class/struct/union type

The IP is not the same but the 3 functions work correctly creating a socket that the server can listen to and send data, to the client.

I would like to poll the client, using this example but in C++.

Which object or structure can I use here with Poll()?

Upvotes: 2

Views: 8461

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 598329

In C#, Socket is a class type, and has a Poll() method.

In C++, SOCKET is a handle type, not a class type, so there is no Poll() method available. You need to use the select() function.

Upvotes: 1

syllogism
syllogism

Reputation: 655

Please read this Tutorial. What you are doing doesn't look close to correct.

Upvotes: 2

Related Questions