| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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. |
|
#2
| |||
| |||
| Hi [~mach], Why do you care? If the IP address changes, all sockets bound to that parti= cular ip address ort 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. |
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 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. |
|
#5
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.