Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment you are required to create a Unix domain socket to TCP socket adapter. You should write three programs in this assignment. The
In this assignment you are required to create a Unix domain socket to TCP socket adapter. You should write three programs in this assignment. The first one is the adapter and other two are for demonstration. You must perform error checks at every step. Adapter should receive address file from command line arguments and should accept unix domain connections through this file. Connections should be handled in separate processes. Once a client is connected, adapter should send "address" and the client should send the domain name of the TCP client. Then the adapter should send "port" and client should respond with the port number or designation. Adapter should then use the address and port in domain name resolution and try to connect the requested server over TCP. Once the connection is done, adapter should send "uk" lo the client. If there is a problem adapler should send "error". After receiving "ok", client is free lo send and receive dala. However, lu keep the program simple, send and receive should be done in order. After sending "ok", adapter should receive data from client, then send it to the server. Then should receive data from the server and send it to client. This should continue until a party closes connection. In that case, adapter should close all connections and exit from the child process. Adapter should be able to handle CTRL+C to exit gracefully. In this assignment you are required to create a Unix domain socket to TCP socket adapter. You should write three programs in this assignment. The first one is the adapter and other two are for demonstration. You must perform error checks at every step. Adapter should receive address file from command line arguments and should accept unix domain connections through this file. Connections should be handled in separate processes. Once a client is connected, adapter should send "address" and the client should send the domain name of the TCP client. Then the adapter should send "port" and client should respond with the port number or designation. Adapter should then use the address and port in domain name resolution and try to connect the requested server over TCP. Once the connection is done, adapter should send "uk" lo the client. If there is a problem adapler should send "error". After receiving "ok", client is free lo send and receive dala. However, lu keep the program simple, send and receive should be done in order. After sending "ok", adapter should receive data from client, then send it to the server. Then should receive data from the server and send it to client. This should continue until a party closes connection. In that case, adapter should close all connections and exit from the child process. Adapter should be able to handle CTRL+C to exit gracefully
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started