| Reply | « Previous Thread | Next Thread » |
|
Has anyone here succesfully used the ao-socket library from PDIS Software. I installed aosocket-series60_v20.sis and pdis.sis but test-programs like test_http_client.py and test_mgr_webclient.py keep throwing AttributeErrors.
The test_http_client throws "AttributeError: SymbianSocket instance has no attribute 'connect'" and the test_mgr_webclient "AttributeError: TcpSymbianAsyncMgr instance has no attribute 'get_socket_class'". Has anyone had the same problem and knows how to fix it, please let me know. I'm using a Nokia 6600 phone and have python installed of course. The reason I want to use the ao-socket library is that I get time-outs when trying to connect to the Internet with standard Python-sockets. Thanks for you help, WTB. |
|
I sent Ken Rimey, developer of the aosocket-library, this question. Because there are probably more people with the same problems and questions I post my mails and his answers here:
>>>>>from me to ken>>>>> Hello, Because I had difficulties connecting to the Internet using Python on my Nokia 6600 I tried your ao-socket libraries. I'm pretty confident that using SymbianSockets will solve my problems but the thing is, I can't get even get the example programs to run! I installed: - PythonForSeries60.SIS - aosocket-series60_v20.sis - pdis.sis And test-programs: - test_http_client.py - test_mgr_webclient.py But the test-programs don't work for me, they both give AttributeErrors. The test_http_client prints "AttributeError: SymbianSocket instance has no attribute 'connect'" and the test_mgr_webclient "AttributeError: TcpSymbianAsyncMgr instance has no attribute 'get_socket_class'" when I remove the catch/except block. Do the test-programs work for you? I tried both 0.7.1 and 0.7.3 releases but none works. It would be great if you could help me to get it working. Thank you for your time. Yours sincerly, W.T. Burgler >>>>>>>>>> <<<<<from ken to me<<<<< See below for help with the example programs, but are you sure you really need our relatively complex socket library? I personally prefer to use the standard socket module built into Python for Series 60 whenever possible (although our aosocket module is indispensable in certain situations, such as when an application needs to be able to listen for incoming data on a TCP connection and also occasionally send some data). tst_mgr_webclient.py doesn't even get that far in 0.7.3. It appears to be badly out of date, and we should probably forget about it. test_http_client.py gave me the same error as you got. The problem is that this test program predates our addition of Bluetooth support, which required some renaming. To make it work, simple replace SymbianSocket with TcpSymbianSocket in the two places it appears in the test program. Sorry about that. By the way, to get log files, use a file browser such as FExplorer to create the directory C:\logs\aosocket before running the test programs. Regards, Ken <<<<<<<<<< >>>>>from me to ken>>>>> Hi Ken, Thank you very much for your quick reply. The standard sockets didn't work for me so that's why I'm trying your advanced socket library. I'm glad to know that the errors are in the test-programs and not in the library itself. I'll try making a little program myself to test if I can make the connections I need, those test-programs aren't that important. Thanks again for your time. Kind regards, Wouter-Tim. >>>>>>>>>> <<<<<from ken to me<<<<< Hi Wouter-Tim, I have appended a simple test program based on standard sockets to the end of this message. If it doesn't work for you, our aosocket stuff won't either. We have a 6600 that we use heavily, so you shouldn't have any problems with that particular model. Are you sure you are using a GPRS access point that allows TCP connections to arbitrary Internet hosts? I imagine that not all service providers support this. I found I needed to set up an additional access point for this, separate from my service provider's GPRS WAP access point. Regards, Ken ---- import sys import socket import appuifw host = u"pdis.hiit.fi" host = appuifw.query(u"Enter host name:", "text", host) if host: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host, 80)) sock.sendall("GET / HTTP/1.0\n\n") while True: data = sock.recv(1024) if not data: break sys.stdout.write(data) <<<<<<<<<< >>>>>from me to ken>>>>> Hello Ken, Thanks for that test-program. It resulted in "socket.error(56, 'Connection timed out')", the same error I got when using regular python-sockets. I used two different service-providers so my guess was that it was a bug in Python for Symbian but apperently it does have to do with my provider (vodafone in holland). Where did you get the details to set up an additional access point or can I just copy my providers details and save it under a different name? I'll post our mails on www.forum.nokia.com, there are probably more people with socket-problems that want to try the ao-socket library. Your example program is a good test. Greetings, Wouter-Tim. >>>>>>>>>> I found his answers to be very useful and hope it's beneficial to you guys too. If anyone can help me with the access point or another solution to my socket-timeouts please reply. WTB. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |