×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    12

    socket doesn't.... close ?!?

    Hi.

    I'm writing a simple irc client, but, if i try this
    code:

    ---
    import sys
    import socket
    import string

    HOST="irc.ircarea.net"
    PORT=6667
    NICK="test1234"
    IDENT="test1234"
    REALNAME="test1234"
    readbuffer=""

    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM )
    s.connect((HOST, PORT))
    s.send("NICK %s\r\n" % NICK)
    s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
    s.send("JOIN #test1234\r\n")
    s.close
    ---

    the gprs connection seems never 'close'
    really.
    The only thing is exit python interpreter.
    bug ?

    thanks

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    11
    If the code you've supplied is an accurate copy, then the problem is simple:

    s.close

    is "the value of the close method of s", whereas

    s.close()

    actually *calls* the close function with no arguments...

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    12
    Originally posted by eichin
    If the code you've supplied is an accurate copy, then the problem is simple:

    s.close

    is "the value of the close method of s", whereas

    s.close()

    actually *calls* the close function with no arguments...
    yes, my fault, the 2 parenthesis are in original code and not work as i have posted.

Posting Permissions

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