main.py 500 B

123456789101112131415161718192021
  1. #!/usr/bin/python2.7
  2. import outgoing
  3. import incoming
  4. import asyncore
  5. def run():
  6. outserv = outgoing.outgoingServer(('localhost', 12345), None)
  7. inserv = incoming.incomingServer('localhost', 12344)
  8. try:
  9. print "Press Ctrl+C to exit."
  10. asyncore.loop()
  11. except KeyboardInterrupt:
  12. print "Exiting..."
  13. print "Sockets might get stuck open..."
  14. print "Just wait a minute before restarting the program..."
  15. pass
  16. if __name__ == '__main__':
  17. run()