Well, this is my first usage of github, It took me about 9 hours to write this code, Might have some errors in it, but it's pretty much simple: The script contains five threads, three threads that are used to establish a connection, and once a connection is established, two threads to send / recieve messages.