Vincent Chu Tinkerer | Leader | Innovator

Senior full stack software developer.
Passionate with technology. Worked at Electronic Arts and Apple before venturing into the startup world.

Socket Programming using C - simple client / server

As one of the four problems in one of the six assignments in CMPT 471 (Networking II), we're asked to create a pair of simple client / server communicating using BSD socket. The client would send a file to the server, the server would echo the file back, and the client would write the file down in a separate location. We will then analyze, using ethereal, what exactly is being sent across the wire.

The server would accept both UDP or TCP connection from the client (the client can specify which type to use). I expected the C source code for socket programming should be quite commonplace online, but surprisingly I cannot find any - maybe I am not using the right keywords.

Hopefully this would be useful to you if you have to deal with legancy socket programming code.

Download FileDownload client.c
Download FileDownload server.c