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 :)


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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.