Opening a socket causes app to crash
| Sat, 2008-07-12 08:45 | |
|
Hi, I built an app which provides a socket so that other local apps can connect and retrieve some information. I tested it in the emu and it worked fine but when I try to run it on a phone, the app crashes with a -18 error. I did some logging to see which line causes the crash and it seems that this line is responsible:
as the last number in the log file is 5 and the 6 is never reached. void CSocketEngine::SocketAcceptL()Anybody any idea why opening "iSocket" might cause the app to crash? thx |
|






Forum posts: 162
Hi Simon,
*If* the code that you've posted is what you are using, there are multiple possible failure points. I'm surprised that you actually managed to go upto the socket opening code!
You are not checking the result of many method calls!
Did Connect succeed? Did Start complete without an error? In fact I think your connection start up failed, you've specified an IAP id of 0 and KCommDbBearerLAN, none of which will probably work on a real device. Since the connection didn't start, Open failed with -18 (KErrNotReady from memory)
http://www.tanzim.co.uk
Forum posts: 10
I very new to symbian programming. What would you suggest to make the app running?
I tried commenting "prefs.SetBearerSet(KCommDbBearerLAN);" and "prefs.SetIapId(0);" out what AFAIK should at least bring up a dialog to choose the AP but the app still crashes with -18.
EDIT
Logging problem solved. I mixed up some lines.
Forum posts: 10
Hi,
I just want to let you know that in the meantime my code is working. I just had to remove all the RConnection stuff and then it worked.