×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    socket bind and connect problems

    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

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: socket bind and connect problems

    The "invalid argument" error is because you specify the argument as a tuple. It should be s.connect(serverHost, serverPort) (one set of brackets).

Similar Threads

  1. Failed to connect a TCP client app with a server
    By abolfoooud in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2008-08-24, 07:47
  2. TCP server packet receiving problem
    By raj_rr7 in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2007-07-12, 12:24
  3. bind pbm in server socket
    By rees in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-11-15, 13:15
  4. Socket problem
    By defragger in forum Symbian
    Replies: 0
    Last Post: 2005-08-25, 08:16

Posting Permissions

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