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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Socket programming

Socket programming

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 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.
  • N Offline
    N Offline
    nahitan
    wrote on last edited by
    #1

    Hi there, I have an application that is receiving messages from some mobile devices from eight different locations through GPRS using UDP sockets, and I am supposed to send the messages to the 2nd application using TCP/Ip sockets some how that there will be no confusion for the response that comes from the 2nd application that I am supposed to transfer to the device that has sent the original message. For example if I can have the same Ip address and use 8 different ports for that to send to the 2nd application and receive the response back. Th question is how can I do that without creating 8 sockets? Appreciates any idea

    M 1 Reply Last reply
    0
    • N nahitan

      Hi there, I have an application that is receiving messages from some mobile devices from eight different locations through GPRS using UDP sockets, and I am supposed to send the messages to the 2nd application using TCP/Ip sockets some how that there will be no confusion for the response that comes from the 2nd application that I am supposed to transfer to the device that has sent the original message. For example if I can have the same Ip address and use 8 different ports for that to send to the 2nd application and receive the response back. Th question is how can I do that without creating 8 sockets? Appreciates any idea

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I think your two choices are 1) Use 8 separate TCP/IP sockets, 1 for each mobile source. 2) Use one TCP/IP socket connection and wrap the UDP datagram in a packet containing a header that indicates which mobile source the message came from. The same way a TCP packet wraps an IP packet. Mark

      N 1 Reply Last reply
      0
      • M Mark Salsbery

        I think your two choices are 1) Use 8 separate TCP/IP sockets, 1 for each mobile source. 2) Use one TCP/IP socket connection and wrap the UDP datagram in a packet containing a header that indicates which mobile source the message came from. The same way a TCP packet wraps an IP packet. Mark

        N Offline
        N Offline
        nahitan
        wrote on last edited by
        #3

        Thanks for the tip, but the 2nd applicstion does not check the header that actually is there containing the mobile id, group id. Regards,

        M 1 Reply Last reply
        0
        • N nahitan

          Thanks for the tip, but the 2nd applicstion does not check the header that actually is there containing the mobile id, group id. Regards,

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          nahitan wrote:

          ...the 2nd applicstion does not check the header that actually is there containing the mobile id, group id.

          Bummer :)

          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