You Are Here:

Community: Developer Discussion Boards

#1 Old socket bind and connect problems - 2008-04-02, 20:13

Join Date: Apr 2008
Posts: 1
thakadu
Offline
Registered User
Hi

Does anyone know why using version 1.4.2 final the following error occurs?

from socket import *
serverHost = ''
serverPort = 2000

s = socket(AF_INET, SOCK_STREAM) # create a TCP socket
s.connect((serverHost, serverPort)) # connect to server on the port

This results in an error on the s.connect() call:

error: (22, 'Invalid argument')

A similar error occurs if you call s.bind()

both scripts work fine in other environments.


I am also not sure why some standard library modules are
missing for example all
of BaseHTTPServer and SocketServer are not available.

Anyone have any ideas?


Regards
Reply With Quote

#2 Old Re: socket bind and connect problems - 2008-04-02, 20:25

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
The "invalid argument" error is because you specify the argument as a tuple. It should be s.connect(serverHost, serverPort) (one set of brackets).
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to connect a TCP client app with a server abolfoooud Symbian Networking & Messaging 10 2008-08-24 08:47
TCP server packet receiving problem raj_rr7 Symbian Networking & Messaging 9 2007-07-12 13:24
bind pbm in server socket rees Symbian Networking & Messaging 0 2006-11-15 14:15
Socket problem defragger Python 0 2005-08-25 09:16
socket问题请教 sword-jj Symbian 2 2003-07-08 16:23

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia