top of page

Winsock Chat Application

OVERVIEW

- C++ / Visual Studio

- Winsock Interface

- Student Project

ABOUT

 

Whilst learning and developing my skills with C++ code, i created a chat application using the Winsock programming interface with an object orientated approach. The screenshots below show the app where a client program and server program can communicate with each other by sending and receiving messages.

The code screenshots show a parent class named 'Comms' in which most of the initialization for both the server and client sockets are done. The 'Server' and 'Client' classes both inherit from the Comms base class, inheriting the initialized sockets, these two classes then have the more specific functions within them such as the Client attempting to connect to the server and the server accepting that connection.

The program also exhibits exception handling in most of the functions, as shown in the code examples and the chat screenshot, here it shows that the client threw a socket bind error, but was still able to connect to the server. One other feature exhibited here are pre-processor directives, but more specifically conditional includes, this is shown within the main functions of both the client and server configured programs, you can see within the first code screenshot that only the client or only the server code will run depending on how the includes have been defined.

bottom of page