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 GPRS

UDP socket and GPRS

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 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

    I am not sure when we use an UDP socket to send and receive messages from one windows application to a mobile device that uses a modem and SIM card, where a port be assigned to an IP. say I have a SIM card with fix IP xxx.xxx.xxx.xxx, when I send a message I get it in my Windows base app as coming from that IP and a big port number (i.e. 48618). The SIM card provider suggests that they don't assign any port number to a SIM card. the thing is that after a while the port number gets changed if there is no traffic and My application can't send a message to the device as I send to the IP and the port that I got the last message from. Best, Nahita

    L C 2 Replies Last reply
    0
    • N nahitan

      I am not sure when we use an UDP socket to send and receive messages from one windows application to a mobile device that uses a modem and SIM card, where a port be assigned to an IP. say I have a SIM card with fix IP xxx.xxx.xxx.xxx, when I send a message I get it in my Windows base app as coming from that IP and a big port number (i.e. 48618). The SIM card provider suggests that they don't assign any port number to a SIM card. the thing is that after a while the port number gets changed if there is no traffic and My application can't send a message to the device as I send to the IP and the port that I got the last message from. Best, Nahita

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

      If there is an application on that mobile device that you want to communicate with, you have to have the specification for communicating with the application, you can't just guess at how to do it. Do you have the specification?

      led mike

      N 1 Reply Last reply
      0
      • N nahitan

        I am not sure when we use an UDP socket to send and receive messages from one windows application to a mobile device that uses a modem and SIM card, where a port be assigned to an IP. say I have a SIM card with fix IP xxx.xxx.xxx.xxx, when I send a message I get it in my Windows base app as coming from that IP and a big port number (i.e. 48618). The SIM card provider suggests that they don't assign any port number to a SIM card. the thing is that after a while the port number gets changed if there is no traffic and My application can't send a message to the device as I send to the IP and the port that I got the last message from. Best, Nahita

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

        nahitan wrote:

        the thing is that after a while the port number gets changed if there is no traffic

        Can't you ping the device time to time? I supose when there is no communication for a while it will "timeout" and close the socket or whatever it uses and when it has something to send it will create a new one, send the message from there and keep it up again for a while. But if you don't let it timeout it might stick to the original port.

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

        N 1 Reply Last reply
        0
        • C Code o mat

          nahitan wrote:

          the thing is that after a while the port number gets changed if there is no traffic

          Can't you ping the device time to time? I supose when there is no communication for a while it will "timeout" and close the socket or whatever it uses and when it has something to send it will create a new one, send the message from there and keep it up again for a while. But if you don't let it timeout it might stick to the original port.

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

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

          to maintain a port you need to send a ping every 45 seconds that is a lot of data and if you have 2000 devices, that would be a big number. I am just wondering where a port gets assigned. Thanks,

          C 1 Reply Last reply
          0
          • L led mike

            If there is an application on that mobile device that you want to communicate with, you have to have the specification for communicating with the application, you can't just guess at how to do it. Do you have the specification?

            led mike

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

            I can communicate with the application to the mobile device fine. My problem is that the port gets changed time to time and I was wondering if anybody knows where a port gets assigned in GPRS for a UDP socket. Thanks,

            L 1 Reply Last reply
            0
            • N nahitan

              to maintain a port you need to send a ping every 45 seconds that is a lot of data and if you have 2000 devices, that would be a big number. I am just wondering where a port gets assigned. Thanks,

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

              If there is no fix port number you can communicate with, how do you make a "connection" (i know it is connection less UDP) to the device the first place?

              > 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
              • N nahitan

                I can communicate with the application to the mobile device fine. My problem is that the port gets changed time to time and I was wondering if anybody knows where a port gets assigned in GPRS for a UDP socket. Thanks,

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

                A port represents a way to identify which specific process a packet is addressed for on a system where multiple processes share the same network connection. Therefore ports are generally an application level mechanism. If the mobile device does not use this typical approach then I don't know what it uses, but someone does that would be related to that specific device. In a typical use of a TCP/IP stack the application can choose to be assigned a random port from the stack. In that case the "where" is in the TCP/IP stack code. Either way, I don't understand how knowing "where" the port assignment occurs helps you do anything about it. That aspect of the mobile devices system is not going to be exposed to your remote application. You will have to use the specifications for that device/application, as I previously stated, for communicating with it/them, period.

                led mike

                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