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

MFC Socket

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminregexhelp
3 Posts 2 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.
  • R Offline
    R Offline
    reddy07
    wrote on last edited by
    #1

    Hi, I am working on MFC Asynchronoussocket program, I could able to successfully send and receive messages between one to one client and server using accept, receive classes. But when i am trying to connect multiple client to server, my application crashes. And I also wonder, if I able to accept multiple client, how would I match the send and receive messages between different clients and server. Could anyone please help me out!!! Thanks Reddy

    D 1 Reply Last reply
    0
    • R reddy07

      Hi, I am working on MFC Asynchronoussocket program, I could able to successfully send and receive messages between one to one client and server using accept, receive classes. But when i am trying to connect multiple client to server, my application crashes. And I also wonder, if I able to accept multiple client, how would I match the send and receive messages between different clients and server. Could anyone please help me out!!! Thanks Reddy

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      reddy07 wrote:

      And I also wonder, if I able to accept multiple client, how would I match the send and receive messages between different clients and server.

      I've only looked at the basics of this quite some time ago, but the structure that accept() populates on the server has a sin_addr member. Can you pass that to inet_ntoa()?

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      R 1 Reply Last reply
      0
      • D David Crow

        reddy07 wrote:

        And I also wonder, if I able to accept multiple client, how would I match the send and receive messages between different clients and server.

        I've only looked at the basics of this quite some time ago, but the structure that accept() populates on the server has a sin_addr member. Can you pass that to inet_ntoa()?

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        R Offline
        R Offline
        reddy07
        wrote on last edited by
        #3

        Thanks david, I solved it - now I could able to establish mulitple client with single server, but I am facing problem in receving messages from clients. Server couldnt receive the message that client is sending. On client side, client is sucessfully sending the message. Could you please throw some light. Binding i will look into it later once server start receving messages

        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