c++ - Using IOCP with send() and recv() -
i trying figure out best way handle multiple connections c++ tcp server. stumbled upon epoll()
sadly it's available linux , i'm doing on windows.
after research seems best way handle sockets on windows use of i/o completion ports. use them, client application uses send()
, recv()
(i cannot change that), meaning need use same functions send , receive data client. these functions don't seem used iocp (wsasend()
/ wsarecv()
used instead).
i'd know if there's still way able use iocp send()
, recv()
? or should other methods?
i need use same functions send , receive data client
that's incorrect. client has no idea how data , out of tcp connection, either way same exact tcp segments sent across network.
if server i/o bound, wsaasyncselect
and/or wsaeventselect
work (and save trouble of multithreading). compute-bound services iocp worthwhile, because distribute work items available thread simultaneous requests can spin , calculations on multiple processor cores.
wsapoll
option.
Comments
Post a Comment