2
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()?

Community
  • 1
  • 1
T.T.T.
  • 29,703
  • 45
  • 120
  • 161

2 Answers2

2

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

syllogism
  • 655
  • 1
  • 4
  • 12
1

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.

Remy Lebeau
  • 454,445
  • 28
  • 366
  • 620