Visual C++

Moderators: Lundin
Number of threads: 373
Number of posts: 687

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
UDP socket and GPRS network messaging Posted by mWire on 11 Dec 2008 at 7:13 AM
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
Report
Re: UDP socket and GPRS network messaging Posted by mariogomes on 16 Dec 2008 at 7:10 AM

Hi There
Mybe you solv your problem using a SIM
card with FIX IP.
I have a similar project.
How do you comunicate from server to
device? You use internet or only GPRS
Network?
Can you send me your source code?

Thanks




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.