create a chat server and client
In this project, you need to write a new network service for your computer. You will have to use the POSIX APIs for threads and network sockets that we learn about in class. So, if you have a Mac, you are in luck! If not, the VM that I made available will work, as will any Linux machine.
Good news! You can write your code in C++ so you have access to the standard library. Unfortunately, the POSIX APIs are still defined in a C-compatible way. That means you will still be using those functions that operate on structs passed around by pointer. Alternatively, you can write this program in Python if you only import socket and threading as your networking and concurrency libraries. You can still import and use other libraries, such as os, sys, and math. If you have any question of if a library is allowed or not, you can come ask me.
Your task for this project is to create a chat server and client. Both should be run on the command line with two arguments: the IP address and port of the server. So, if you write the code in C and compile the client to an executable called client the program will be run like this: ./client 127.0.0.1 9000. All data the server sends to the client should be displayed on screen. The server should greet the user, tell them what other users are there, and ask name the user wants to use by sending text over the connection. The client should then send a single word followed by a newline that is the name they want to use. Then, whenever a client wants to send a message, it should send the message and followed by a newline., e.g. Hello, world!n. The server should forward that to all other clients with the username and a greater-than sign prepended. So other clients then see username > Hello, world!.The server should be able to handle 20 clients, and when the 21st tries the server should not accept the connection. This task is far easier described than done, so please start early!
One thing you may find very helpful in debugging is the program netcat. It allows you to send plain text over the network. This lets you perform the logic of the client or a server handling a single client yourself. To run it as a server, run netcat -l 9000 and to run it as a client try netcat localhost 9000. It displays what is received and sends whatever you enter!
Using our article writing service
Our working experience, customer feedback, and market resources have brought about the creation of an exclusive online service. Have you ever wanted to do all of your homework to the best of your abilities but got stuck on the very first task on your to-do list? We know that you deserve your rest, quality time and we are ready and able to handle all your research and academic requirements.
Writing papers is a common source of headaches for students everywhere, especially if they intend to produce something their instructor would consider “excellent”. If you seek professional help with your essays, know that our essay writing service is 24/7 ready to take on your task. Our skilled writers can help you with any assignment you may find hard. Discover what benefits you get by asking us to complete your paper.
We have delivered more than 98% of student’s papers before the deadline so far. Order your writing task from us and we will send it exactly when you expect it. Great result in a short timeframe. We’re here for you day and night. Connect with customer support around-the-clock for any orders or urgent questions.
For that professional touch we go over all finished work check spelling grammar and formatting to make sure the assignment looks polished and excellent. All our essays are checked for plagiarism before hand over as well an extra set of experts in our QA department to examine on the quality.
If you have done the research and need our specialist to make it worthy of top marks, we will completely rewrite your paper while we guarantee originality. Ask your writer for adjustments and you will have them in no time.
We often write papers on client friendly price on our website, and you can always choose a longer deadline to save a bit on the price of your order. The more pages you order also reduces the price considerably.
We know that half of the process depends on customers and their ability to articulate instructions in an effective way. Their views on desired final products must be made clear to the writers. The diversity of the orders we receive has also enable us to largely improve our analytical and research capabilities. Working in the field of academic assistance for a relatively long period we understand that the customer can effectively manage the orders by consistent communication with the writer.
We offer a convenient, simple and unique platform for collaboration between customers and professional writers willing and able to dedicate their skills towards customers’ academic success. Our company support team as well as regulations are excellent and easy to work with for the customer thus fostering professionalism. Our focus is to be a reliable partner and create a long term cooperation with you. For those pursuing personal development, as essay-doyen we look forward to offering you numerous interesting projects and opportunities for self-improvement.
Our company is one of the largest and most reliable essay writing services in the world. We provide all forms of assignment help including essay writing, research writing help, calculations help, statistics help, and custom essays help. We have provided custom writing services to thousands of students around the world. We are also among the most affordable essay help service in the world.
Use our service today and experience from academic experts.
Order this paper now, contact us through chat for any query
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more