Question: CS480 Socket Programming Lab1 Overview Work individually or in a group of no more than three members to build two simple client/server applications using C#

CS480 Socket Programming Lab1

Overview

Work individually or in a group of no more than three members to build two simple client/server applications using C# sockets. The first one is a simple echo/chat service. The second one is a simple file transfer service.

Procedure and Details (30 points): Compile, Test, And Extend Example Echo Application

_______ Obtain a copy of the code for the echo client, and the echo server on the course web site.

______ Create two folders first, one for server and one for client. For example, c:\server and c:\client

Build EchoServer and EchoClient in Visual Studio 2010/2012:

Now your server and client applications should be in their folders, suppose server is in c:\server\server\debug\ and client application is in folder c:\client\client\debug\.

_______ To test the server, you will need a unique application number greater than 1025, such as 2000x, where x is 0 to 9.

Open a DOS window, change directory with cd command to the directory where server application is, suppose c:\server\server\debug\. Run server application with server 2000x.

Open another DOS window, change directory with cd command to the directory where client application is, suppose c:\client\client\debug\. Run client application with client localhost 2000x. Or you can use ipconfig command to get your computer IP address, suppose it is 192.168.0.1, then run client application with client 192.168.0.1 2000x.

After sending some echo messages, you can quit your client application by enter exit.

Now you can shut down your server application.

_______ Test the client and server by running the server on one computer and the client on another. You may need to use ipconfig command to get the server IP address for the client.

_______ Modify the server to keep a log file containing all data the server echoes. Save your server application with name serverX, and client with name clientX, where X is the number you picked before.

_______ every group submits your serverX.cs, clientX.cs, serverX.exe and clientX.exe, to the drop box before due date.

Write a chat application (35 points):

_______ Modify the echo client and the echo server so they both can chat with each other, in this case, it is a chat application. During the chat, they each require the user to enter a name (an arbitrary string). Prepend the name followed by a greater-than sign to each line of text before sending the text across the network.

_______ If both sides like to record the chatting, log file would certainly serve this purpose. Modify the code so that each side has its own log file to record all of the chatting information.

_______every group submits your chatsX.cs, chatcX.cs, chatsX.exe and chatcX.exe, to the drop box before due date.

Write a simple file transfer application (35 points):

_______ Modify the echo client and the echo server so the client can send a file to the server, in this case, it is a simple file transfer application. Proper user interaction should be provided.

_______ You may consider to use FileStream(from System.IO), its read() and write() methods. You may also consider using our discussions about sending and receiving variable length messages (check socket slides).

_______every group submits your ftpsX.cs, ftpcX.cs, ftpsX.exe and ftpcX.exe, to the drop box before due date.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!