22, invalid agument error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Infinite Corridor

    #1

    22, invalid agument error

    I am trying to get an echoserver running on my N80 Nokia cell phone,
    that uses "python for s60".
    What worked:
    I ran echoclient on the phone and echoserver on my Powerbook and it
    worked.

    What doesnt work:
    When I try running the same scripts, so that I run echoclient on the
    laptop and echoserver on the cellphone, the echoserver doesnt work(Yes,
    I have changed the IP address correctly).

    The error I get is:

    File "e:/python/echoserver.py". line
    15 in ?
    sockobj.bind((' ',40007))
    # bind it to server port number
    File "<string>", line 1, in bind
    error: (22, 'Invalid argument')

    Why is this program showing an error on the cellphone when it is
    running fine on the Mac?

    Thanks, any help will be appreciated.

    Dave

  • Justin Ezequiel

    #2
    Re: 22, invalid agument error

    sockobj.bind((' ',40007))

    tried on my N6600 with same error

    try using your phone's IP instead of the empty string ''

    tried sockobj.bind((' 127.0.0.1',4000 7)) and did not get an error

    Comment

    • kondal

      #3
      Re: 22, invalid agument error

      sockobj.bind((' ',40007))
      >
      tried on my N6600 with same error
      >
      try using your phone's IP instead of the empty string ''
      >
      tried sockobj.bind((' 127.0.0.1',4000 7)) and did not get an error
      In general sockets layer bind with null host makes it pick the address
      from arp resolution and null in port makes it pick a random number as a
      source port. This is reason bind call is not required for client
      connections.

      I think Python for S60 has some problem in sockets layer for the bind
      function. Best is to remove the bind call in the client program as
      people will test with this senario in general.

      Comment

      • Infinite Corridor

        #4
        Re: 22, invalid agument error


        Justin Ezequiel wrote:
        sockobj.bind((' ',40007))
        >
        tried on my N6600 with same error
        >
        try using your phone's IP instead of the empty string ''
        >
        tried sockobj.bind((' 127.0.0.1',4000 7)) and did not get an error
        I didn't get an error either, but the whole thing hangs up, and I am
        forced to abort the program. This has happend quite a few times
        already.
        Did it work for you normally?

        Thanks

        Comment

        • Infinite Corridor

          #5
          Re: 22, invalid agument error


          kondal wrote:
          sockobj.bind((' ',40007))
          tried on my N6600 with same error

          try using your phone's IP instead of the empty string ''

          tried sockobj.bind((' 127.0.0.1',4000 7)) and did not get an error
          >
          In general sockets layer bind with null host makes it pick the address
          from arp resolution and null in port makes it pick a random number as a
          source port. This is reason bind call is not required for client
          connections.
          >
          I think Python for S60 has some problem in sockets layer for the bind
          function. Best is to remove the bind call in the client program as
          people will test with this senario in general.
          Well the bind call is in the server program, not the client. I want to
          run the server program on the cellphone.
          Any idea how to fix it?

          Thanks!

          Comment

          • Justin Ezequiel

            #6
            Re: 22, invalid agument error

            Infinite Corridor wrote:
            Justin Ezequiel wrote:

            tried sockobj.bind((' 127.0.0.1',4000 7)) and did not get an error
            >
            I didn't get an error either, but the whole thing hangs up, and I am
            forced to abort the program. This has happend quite a few times
            already.
            Did it work for you normally?
            >
            am unable to test as my current PCs do not have bluetooth (yet)
            sorry

            Comment

            Working...