Exemplo n.º 1
0
def main():

	port = common.PORT
	username = input("Choose a username : "******"", flush=True)

	signal.signal(41, pause_handler)
	signal.signal(42, chat_handler)

	signal.pause()

	chat.chat(port, username)

	p.terminate()
Exemplo n.º 2
0
def main():

	port = common.PORT
	username = input("Choose a username : "******"", flush=True)

	signal.signal(41, pause_handler)
	signal.signal(42, chat_handler)

	signal.pause()

	try:
		chat.chat(port, username)
	except (KeyboardInterrupt, SystemExit): # Handle the ctrl+c
		chat.broadcast(port, chat.encode(username, '{} leaved the chat'.format(username), special=True))
		print('*** Quitting ***')

	p.terminate()
Exemplo n.º 3
0
def main():

	port = common.PORT
	username = input("Choose a username : "******"", flush=True)

	signal.signal(41, pause_handler)
	signal.signal(42, chat_handler)

	signal.pause()

	try:
		chat.chat(port, username)
	except (KeyboardInterrupt, SystemExit): # Handle the ctrl+c
		chat.broadcast(port, chat.encode(username, '{} leaved the chat'.format(username), special=True))
		print('*** Quitting ***')

	p.terminate()