pointcli switched to tcp

This commit is contained in:
Curt Hash 2010-02-09 16:46:44 -07:00
parent 09d5b1385c
commit 54a19779c3
1 changed files with 4 additions and 4 deletions

View File

@ -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',