MFC Socket
The MFC CSocket provides a wrapper for the Berkeley C Socket API for TCP and
UDP sockets. CSocket is a derived class of CAsyncSocket. It
encapsulates the details of a C socket and thus makes life much easier for
Windows socket programmers. CSocket can implement both blocking/synchronous and
unblocking/asynchronous sockets. In this site, you can find a number of
networking programs we wrote. Below is a list of
these programs.
- TCP CSocket Examples
- TCPEchoClient.cpp - Implements a
simple TCP echo client. It first connects to a TCP echo server, and then
it sends and receives an echo word supplied by the user on the command
line.
- TCPEchoServer.cpp - Implements an
iterative TCP echo server.
- TCPEchoServer-Thread.cpp -
Implements a simple threaded TCP echo server, which spawns a new thread
for each client.
- HandleTCPClient.cpp -
Function to handle a single client connection for the echo servers.
- UDP CSocket Examples
- UDPEchoClient.cpp - Implements a
simple UDP echo client. It first connects to a UDP echo server, and then
it sends and receives an echo word supplied by the user on the command
line.
- UDPEchoServer.cpp - Implements a
simple UDP echo server.
- Utility Program
- Make sure to read the README.txt file for
compilation instructions.
- Click here to get more detailed information about
the above programs.