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. UDP socket and IP: Port [modified]

UDP socket and IP: Port [modified]

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

    Hi there, I have an application that sits between mobile devices and another application. I use UDP socket from mobile devices (GPRS network the device uses a modem and SIM card) to my application and TCP from my application to the second application. the mobile device is supposed to send a message to my app and from my app to the 2nd application and the second application sends a response back to that specific device via my application. So I record mobile id and IP and port that I got the message from and save it in a memory to use it for response back to the device. the problem is when my application crashes, I lose all the IP and port information and the message that should go to the mobile device would not get it there until I get a message from the mobile and save the info. I tried to save all the info in a file and read it back in start up but I noticed that when I restart my application the port number for the specified device will change and the information that I saved is useless (i.e. I am sending a message to an IP (which is correct) and a port (that has changed)). My question is like this: is there anyway to use UDP sockets and send/ receive messages but just use a specific IP for each device and do not use any PORT? and if there is, I'll be appreciated if somebody get me a clue. here is what happens for me now: Device to App: got a message: look for device ID and save the IP and PORT for that: Mobile# Z, IP: xxx.xxx.xxx.xxx port: xxxx App to Device Message is supposed to go to device Z --> get the IP and Port send message to xxx.xxx.xxx.xxx port xxxx if My app restarts and I get a message to send to device Z, the port is changed and the message never gets to that unless I get a message from the device and update my information. Due to data usage and as we use VPN tunnel we send heartbeat message every 40 minutes, so the information might not be very updated. Best Nahitan

    modified on Wednesday, December 10, 2008 3:53 PM

    L C 2 Replies Last reply
    0
    • N nahitan

      Hi there, I have an application that sits between mobile devices and another application. I use UDP socket from mobile devices (GPRS network the device uses a modem and SIM card) to my application and TCP from my application to the second application. the mobile device is supposed to send a message to my app and from my app to the 2nd application and the second application sends a response back to that specific device via my application. So I record mobile id and IP and port that I got the message from and save it in a memory to use it for response back to the device. the problem is when my application crashes, I lose all the IP and port information and the message that should go to the mobile device would not get it there until I get a message from the mobile and save the info. I tried to save all the info in a file and read it back in start up but I noticed that when I restart my application the port number for the specified device will change and the information that I saved is useless (i.e. I am sending a message to an IP (which is correct) and a port (that has changed)). My question is like this: is there anyway to use UDP sockets and send/ receive messages but just use a specific IP for each device and do not use any PORT? and if there is, I'll be appreciated if somebody get me a clue. here is what happens for me now: Device to App: got a message: look for device ID and save the IP and PORT for that: Mobile# Z, IP: xxx.xxx.xxx.xxx port: xxxx App to Device Message is supposed to go to device Z --> get the IP and Port send message to xxx.xxx.xxx.xxx port xxxx if My app restarts and I get a message to send to device Z, the port is changed and the message never gets to that unless I get a message from the device and update my information. Due to data usage and as we use VPN tunnel we send heartbeat message every 40 minutes, so the information might not be very updated. Best Nahitan

      modified on Wednesday, December 10, 2008 3:53 PM

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      nahitan wrote:

      the problem is when my application crashes

      Fix the crash. :doh:

      led mike

      N 1 Reply Last reply
      0
      • L led mike

        nahitan wrote:

        the problem is when my application crashes

        Fix the crash. :doh:

        led mike

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

        Good point, but what if the PC restarts for any reason (windows crash, power...)

        1 Reply Last reply
        0
        • N nahitan

          Hi there, I have an application that sits between mobile devices and another application. I use UDP socket from mobile devices (GPRS network the device uses a modem and SIM card) to my application and TCP from my application to the second application. the mobile device is supposed to send a message to my app and from my app to the 2nd application and the second application sends a response back to that specific device via my application. So I record mobile id and IP and port that I got the message from and save it in a memory to use it for response back to the device. the problem is when my application crashes, I lose all the IP and port information and the message that should go to the mobile device would not get it there until I get a message from the mobile and save the info. I tried to save all the info in a file and read it back in start up but I noticed that when I restart my application the port number for the specified device will change and the information that I saved is useless (i.e. I am sending a message to an IP (which is correct) and a port (that has changed)). My question is like this: is there anyway to use UDP sockets and send/ receive messages but just use a specific IP for each device and do not use any PORT? and if there is, I'll be appreciated if somebody get me a clue. here is what happens for me now: Device to App: got a message: look for device ID and save the IP and PORT for that: Mobile# Z, IP: xxx.xxx.xxx.xxx port: xxxx App to Device Message is supposed to go to device Z --> get the IP and Port send message to xxx.xxx.xxx.xxx port xxxx if My app restarts and I get a message to send to device Z, the port is changed and the message never gets to that unless I get a message from the device and update my information. Due to data usage and as we use VPN tunnel we send heartbeat message every 40 minutes, so the information might not be very updated. Best Nahitan

          modified on Wednesday, December 10, 2008 3:53 PM

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          Maybe try running a port scan on the IP if possible. Just an idea, i wouldn't know how...

          > The problem with computers is that they do what you tell them to do and not what you want them to do. <

          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