Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. re:looking for winsock listener tcp c++ example that supports multiple potential clients

re:looking for winsock listener tcp c++ example that supports multiple potential clients

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++sysadmintutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Kurlansky
    wrote on last edited by
    #1

    Looking for c++ winsock example code that will enable the following: Allow for multiple clients each on a different machine ie different ip address to connect in. I would like to listen on the same port for all clients and also once connectivity is established be able to send and receive using this same port for each and all the connections. Currently, with the code I have written connections seem to get established and I initially receive data from the client but when I attempt to send to client I do not get any errors but the client isn't receiving my message either. Then when viewed in Wireshark I see that the messages are associated with "ezmessagesrv". Something to do with unknown caller. One question, the server socket I use to establish the bind and listen, once the accept returns successfully with the new client socket connection should I close the server socket (the one I use to do the listening) and reinitialize before attempting to listen for other client connections?

    F M 2 Replies Last reply
    0
    • A Alan Kurlansky

      Looking for c++ winsock example code that will enable the following: Allow for multiple clients each on a different machine ie different ip address to connect in. I would like to listen on the same port for all clients and also once connectivity is established be able to send and receive using this same port for each and all the connections. Currently, with the code I have written connections seem to get established and I initially receive data from the client but when I attempt to send to client I do not get any errors but the client isn't receiving my message either. Then when viewed in Wireshark I see that the messages are associated with "ezmessagesrv". Something to do with unknown caller. One question, the server socket I use to establish the bind and listen, once the accept returns successfully with the new client socket connection should I close the server socket (the one I use to do the listening) and reinitialize before attempting to listen for other client connections?

      F Offline
      F Offline
      Fareed Rizkalla
      wrote on last edited by
      #2

      Well their are differences between implementations of the Windows version and *nix. Here is the link

      1 Reply Last reply
      0
      • A Alan Kurlansky

        Looking for c++ winsock example code that will enable the following: Allow for multiple clients each on a different machine ie different ip address to connect in. I would like to listen on the same port for all clients and also once connectivity is established be able to send and receive using this same port for each and all the connections. Currently, with the code I have written connections seem to get established and I initially receive data from the client but when I attempt to send to client I do not get any errors but the client isn't receiving my message either. Then when viewed in Wireshark I see that the messages are associated with "ezmessagesrv". Something to do with unknown caller. One question, the server socket I use to establish the bind and listen, once the accept returns successfully with the new client socket connection should I close the server socket (the one I use to do the listening) and reinitialize before attempting to listen for other client connections?

        M Offline
        M Offline
        Moak
        wrote on last edited by
        #3

        Double posting, already answered you here[^].

        Chat in Europe :java: Now with 24% more Twitter

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups