Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to create a three simple programs (two in C, one in Java) that will communicate over a network (a simple 'Hello world'

I am trying to create a three simple programs (two in C, one in Java) that will communicate over a network (a simple 'Hello world' message): a tcp-client in C, a tcp-client in java, and tcp-server in C. The programs must compile in a UNIX-based environment and execute system calls such as (but not limited to) socket(), bind(), gethostbyname(), gethostname(), read(), write(), send(), listen(), pthread_create(), pthread_detach(), getsockname(), and pthread_exit(), etc. For this inquiry, I am just interested in the server program although help with the client porgrams would be great as well. The server program must be able to accept multiple requests from clients and respond simultaneously. The server program (in C) will take a port number as an argument on the command line, used to bind the socket and recieve messages on the correct port; it will also create a server socket (not using auto-binding but the provided port number) for binding the socket. It then will wait for incoming requests from client programs. When a request is recieved, it should create a new detacthed thread used for interpreting the mesage by parsing. The messages recieved will be like html tags. For instance, if Hello is recieved, it will respond with the same message (only, say using the tag Hello). Other tags ultimately will be used and implemented but I am only interested in just getting the simple message echo to work. The child thread will then close the socket and terminate the connection. The main thread will continue to listen. Any implementation suggestions or help would be greatly appreciated.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

Students also viewed these Databases questions

Question

Describe forward scheduling.

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago