0

Is it possible to know which connection sent data wiht recv()?

Current setup is
    - Main Thread spins and waits
        - Thread 1 - do stuff unimportant to socket
        - Thread 2 - accept() -> keep linked list of accetpted sockets

    - Thread 3 - recv()     -> can I know which IP addr/connection sent me the data I am currently reading?

Thank you :)

Ryan

1
Contributor
1
Reply
12
Views
3 Months
Discussion Span
Last Post by ryantroop
0

Nevermind. Case of misunderstanding the recv() function.

For any others who make the same mistake I did, recv should be called on the socket you created from accept()

:-/ Not the bound socket...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.