S
S
s2sk2018-06-30 23:09:48
C++ / C#
s2sk, 2018-06-30 23:09:48

It is possible in more detail about the select function in sockets?

Hello.

I realized that the select function works like this (we are talking about Windows) - I take the fd_set structure and fill it with client sockets (via the FD_SET function) - I call the select function with this structure passed there - after the select call, only sockets that are ready for read/write/error handling. Now what questions do I have: the fd_set structure has an array inside where all sockets are driven and this array has 64 cells. It turns out I need to call the select function (number of clients / 64) times? Or is it possible to drive all clients (more than 64) into the structure somehow at once? Also it turns out that after select in structure there were clients which are ready to reading/writing I just run them through a cycle with recv/send? What are the differences between recv/send and recvfrom/sendto?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-06-30
@jcmvbkbc

what are the differences between recv/send and recvfrom/sendto?

recvfrom returns the address of the sender of the received data. Makes sense with connectionless protocols such as UDP. sendto allows you to send from the same socket to different addresses, again makes sense with connectionless protocols.
The man says it is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question