threading.Thread()
method. You can set a threshold (e.g., maxThreadNumber=10
) for the total number of threads.
A multithreaded server implementation example can be found here.
yourThread.join()
method.
"""
Generate and return an encryption key
Returns:
bytes: this host's encryption key
"""
getPubKey()
"""
Encrypt a message with peer's encryption key
Args:
message (bytes): plaintext message to encrypt
pubkey (bytes): peer's encryption key (formatted as output to getPubKey())
Returns:
bytes: base64 encoded ciphertext
"""
encrypt(message, pubkey)
"""
Decrypt a message with this host's private key
Args:
cipher (bytes): plaintext message to encrypt
Returns:
bytes: decrypted plaintext message
"""
decrypt(cipher)
To ensure multithreading is working correctly on both client and server, you can perform the following simple tests:
htons/ntohs
or struct.pack()
in order to encode a 16-bit (short int) value for transmission. Use htonl/ntohl
or struct.pack()
for 32-bit (long int) values.print
statements to assist with debugging.
Make sure to disable your debugging output before handing in the assignment.
#!/escnfs/home/csesoft/2017-fall/anaconda3/bin/python
) at the beginning of your python files, and make these files executable (i.e., chmod +x yourcode.py
).
Please also specify your Python version in your readme file if your code is written a version different from Python 3.6.[netid@student00 ~] $ ./chatserver.py Port
[netid@student02 ~] $ ./chatclient.py Server_Name Port Username
Port to Use | Name |
---|---|
41001 | Joshua Agron |
41002 | Matthew Ahrens |
41003 | Emma Ascolese |
41004 | Julia Blanchard |
41005 | Brian Cariddi |
41006 | Maria Carroll |
41007 | Mark Cheng |
41008 | Clara Cheong |
41009 | Megha Devaraj |
41010 | Theodore Donegan |
41011 | Ahmed Farag |
41012 | William Gentry |
41013 | John Gordley |
41014 | Emily Grow |
41015 | Alejandro Jose Gutierrez Elizondo |
41016 | Jake Hracho |
41017 | Melka Konshie |
41018 | Tyler Krasny |
41019 | Zachary Kreft |
41020 | Jonathan David Lamptey |
41021 | Sabin Litchfield |
41022 | Nicholas Locascio |
41023 | Keegan MacDonell |
41024 | John Masciopinto |
41025 | Jacob Mazur |
41026 | Mary McCann |
41027 | Daniel McFarlane |
41028 | Evan Mercurio |
41029 | Conor Murphy |
41030 | Peter Oliver |
41031 | Ryan Pairitz |
41032 | Thomas Renfrew |
41033 | John Rundle |
41034 | Matthew Shan |
41035 | Luke Siela |
41036 | Dane Williams |