From 54a19779c32620e0e6f692b675f1439844adf295 Mon Sep 17 00:00:00 2001 From: Curt Hash Date: Tue, 9 Feb 2010 16:46:44 -0700 Subject: [PATCH] pointcli switched to tcp --- ctf/pointscli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ctf/pointscli.py b/ctf/pointscli.py index 94133e9..6982691 100755 --- a/ctf/pointscli.py +++ b/ctf/pointscli.py @@ -6,9 +6,9 @@ import socket import time from . import points -def makesock(host): - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - s.connect((host, 6667)) +def makesock(host, port=6667): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.connect((host, port)) return s def submit(cat, team, score, sock=None): @@ -32,11 +32,11 @@ def submit(cat, team, score, sock=None): # Ignore wrong ID continue if txt == 'OK': + sock.close() return else: raise ValueError(txt) - def main(): p = optparse.OptionParser(usage='%prog CATEGORY TEAM SCORE') p.add_option('-s', '--host', dest='host', default='localhost',