A program I wrote in C that helped me reinforce the concepts of signals and sockets.
Allows for two users to connect to one and other and communicate through the terminal windows. The design of the code involved making a single InstantMessage.c file as oppossed to two separate User1.c and User2.c files for quicker compilation and debugging.
#####1. One Machine: You may use a single machine and have two terminals open to represent the instant messaging conversation between two users.
#####2. Two Machines: You may use two different machines on the same network. User1 would connect on one machine and wait for a connection through the form of an IP address from User2 on the other machine.
#####In order to execute this program:
-
Clone the repository
-
To simulate a session, open two terminal windows that will represent user1 and user2
-
Enter "
Make" at the respective directory -
To represent user1, execute "
./InstantMessage" in one of the terminal windows. -
To represent user2, execute "
./InstantMessage XXX.XX.XX.X" with a command line argument of your IP address in place of the X's.
#####On a Windows 8 Machine:
-
Hold "
Windows Key + R" to open a command prompt. -
Enter "
cmd" in the prompt. -
Enter "
ipconfig" in the terminal window. -
Locate your IP address and pass this address as a command line argument in Step 5 of Configuration.
#####On a Linux Machine:
-
Hold "
CTRL + SHIFT + T" to open a terminal window. -
Enter "
ifconfig" in the terminal window. -
Locate your IP address and pass this address as a command line argument in Step 5 of Configuration.
If you have any questions/comments or another form of feedback, feel free to email me at anton@karpus.net