Discussion Board
-
socket doesn't.... close ?!?
2005-05-02, 00:03
#1
Registered User
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
-
Registered User
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...
-
Registered User
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
-
Forum Rules