Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction implement two simple applications that use socket to communicate with a remote server. You can finish this project using the following programming language: C/C++
Introduction implement two simple applications that use socket to communicate with a remote server. You can finish this project using the following programming language: C/C++ Remote server The address of the remote server referred in the rest of instruction is segmentationfault.coredumped.tech. Part 1 TCP Socket Implement a simple program that use a TCP socket to communicate with a remote server. Follow the instructions listed below: 1 Send your lastname.# to remote server with TCP socket. Port number: 12345. example code: socket.send("buckeye.1") 2 Receive a string from the remote server example code: received = socket.recv(4096) Put the codes you use for step 1 and 2 in a script named top socket.c. Make sure your script compiles and runs in terminal with one of following comments: C/C++ gec top socket.c -o top socket__/tcp. socket Part 2 UDP Socket Implement a simple program that use a UDP socket to communicate with a remote server. Follow the instructions listed below: 1 Send the string you received from part 1 to remote server with UDP socket. Port number: 54321. example code: s.sendto("202fc9e9-48ea-409f-b72f-246eea4e537d", (host address,port#)) 2 Receive a confirmation from the remote server, which indicates that you have finished both part 1 and part 2 of this project. example code: s.recyfrom(4096) Put the codes you use for step 1 and step 2 in a script named udp_socket.c Make sure your script compiles and runs in terminal with one of following comments: C/C++ gcc udp_socket.c -o udp socket; -/udp_socket Testing Make sure you test the code. Environment You can test your program on student stdlinux, if your program compiles and runs correctly on stdlinux
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