summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py20
1 files changed, 1 insertions, 19 deletions
diff --git a/main.py b/main.py
index ce2346c..66b451f 100644
--- a/main.py
+++ b/main.py
@@ -12,25 +12,7 @@ def main():
client = ogClient(ip, int(port))
client.connect()
-
- while 1:
- sock = client.get_socket()
- state = client.get_state()
-
- if state == State.CONNECTING:
- readset = [ sock ]
- writeset = [ sock ]
- else:
- readset = [ sock ]
- writeset = [ ]
-
- readable, writable, exception = select.select(readset, writeset, [ ])
- if state == State.CONNECTING and sock in writable:
- client.connect2()
- elif state == State.RECEIVING and sock in readable:
- client.receive()
- else:
- print "bad state" + str(state)
+ client.run()
if __name__ == "__main__":
main()