Changing IP address

This is a discussion on Changing IP address within the Symbian forums in Other Technologies category; In the setup I am working on, it is possible that a mobile phone, during op= eration gets allocated a different IP address.=20 Of course, I could write a simple CActive class that checks regularly wheth= er the IP address has changed and sends out a warning in case it did.=20 But I wondered whether there isn´t already a class and/or method in s= ymbian that takes care of this....

Go Back   Application Development Forum > Other Technologies > Symbian

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-08-2008, 12:39 PM
mach
Guest
 
Default Changing IP address

In the setup I am working on, it is possible that a mobile phone, during op=
eration gets allocated a different IP address.=20
Of course, I could write a simple CActive class that checks regularly wheth=
er the IP address has changed and sends out a warning in case it did.=20
But I wondered whether there isn´t already a class and/or method in s=
ymbian that takes care of this.
Reply With Quote
  #2  
Old 06-08-2008, 01:40 PM
maxpayne
Guest
 
Default Re: Changing IP address

Hi [~mach],

Why do you care? If the IP address changes, all sockets bound to that parti=
cular ip addressort tuple will get disconnected, so you'll have to re-est=
ablish the connection again. Well, at least that's the scenario for now, ti=
ll 802.21 comes of age :-)

Cheers.
Reply With Quote
  #3  
Old 06-08-2008, 05:36 PM
mach
Guest
 
Default Re: Changing IP address

Okay, I think I understand where you´re getting at, but I´m not=
sure.=20
I have a mobile phone that interacts with an "service centre", on a PC far =
away. This "service centre"=20
sends messages to the phone by means of IP sockets. So, if the phone sudden=
ly has a different
IP address, the phone has to warn the "service centtre" about that so it wi=
ll send the message=20
to the correct address again.=20

What I guess you mean is: in the RunL method of my CActive class on my phon=
e, as soon=20
as the IP adddress changes, all connections will close, and hence the iStat=
us flag will not be=20
KErrNone, but....some kind of error, I guess. KErrDisconnected maybe? Or so=
mething else?

Is that what you meant?

Edited by: mach on 08-Jun-2008 22:36
Reply With Quote
  #4  
Old 06-09-2008, 07:27 AM
maxpayne
Guest
 
Default Re: Changing IP address

Hi [~mach],

Exactly. For remore disconnections, the socked is errored with KErrEof. For=
local disconnections, like connection drropped, its a bit more subtle prob=
lem, as there's no standard error code that will returned (some but not all=
that you can lookout for is KErrCancel, KErrTimedOut, KErrDisconnected). Y=
ou're best bet is to simple any error coming from the socket and decide whe=
ther to retry again.

You could however, improve the re-trying scenario somehwat, by monitoring a=
connection (as long as you are using explicit sockets, i.e. using the sock=
ets with RConnection), but more on that later, if you are interested :-)

Hope that helps.
Reply With Quote
  #5  
Old 06-09-2008, 12:08 PM
mach
Guest
 
Default Re: Changing IP address

Monitoring the connection might be an interesting option. All I want is som=
e server in the background that monitors the connection and sends a message=
when something has changed. but otherwise, I could use the solution as all=
ready sugggested.=20

Many thanks.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:40 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.