pthread_create()
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.
pthread_join()
method.
/* Generate and return an encryption key
* (won't generate a new one if one exists already)
* return: this host's encryption key
*/
char* getPubKey();
/* Encrypt a message with peer's encryption key
* char *message: plaintext message to encrypt
* char *pubkey: peer's encryption key (formatted as output to getPubKey())
* return: base64 encoded ciphertext
*/
char* encrypt(char *message, char *pubkey);
/* Decrypt a message with this host's private key
* char *cipher: base64 encoded ciphertext
* return: decrypted plaintext message
*/
char* decrypt(char *cipher);
htons/ntohs
in order to encode a 16-bit (short int) value for transmission. Use htonl/ntohl
for 32-bit (long int) values.printf
or cout
statements to assist with debugging. Make sure to add in a carriage return or do a flush on the I/O buffer to ensure that debug information is displayed before program crashes occur. Make sure to disable your debugging output before handing in the assignment. -lcrypto -lpthread
.[netid@student00 ~] $ ./chatserver Port
[netid@student02 ~] $ ./chatclient 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 |