TcpLib
Loading...
Searching...
No Matches
TcpLib (© 1995 Helmut Jakoby)

Introduction

When I was faced with the task of building a client-server application without the help of libraries like Boost or Qt for "Windows" and "Linux", the only option left was to access sockets like Winsock.

Approach

The first steps were frustrating and difficult for me. The explanations and explanations of Felix Opatz were a great help.

TCP wrapper classes

This brings me to the topic of TCP wrapper classes. I didn't want to have to keep the whole TCP stuff in my head and program it all over again the next time I had to develop a client-server application. I chose to design reusable client and server base classes.

Well then; here they are (tcp::Client and tcp::Server).

To keep the handling simple but also flexible, simple derivations from the client and server class with overwriting of one or two methods are possible (see MyTestClient and MyTestServer).

Other methods of classes that can increase flexibility are virtual and described as such.

Example

The two example classes, MyTestServer and MyTestClient, are used to illustrate the usage.

Example Main with MyTestServer

Example Main with MyTestClient