Project shows base example how to use base technique for sending tcp/ip socket to another process
in Limux system. Also project shows how to make SSL
connection over tcp/ip
.
Disgram below shows simple scheme with clients hosts snd server host.
Host has two type of processes:
- Listener, see source
mylsnr.cpp
for details. - Dispathcer, see source
mydisp.cpp
for details.
The remote process,
- Client, see source
myclnt.cpp
for details.
┌─────────────────────────────────────────────────────────┐
│ │
│ │
│ │
│ ┌─────────────┐ │
┌────────┐ │ │ │ │
│ │ │ │ Dispatcher │ │
│ ├──────────┐ │ ┌─────────► │ │
│Client │ │ │ │ │ │ │
│ │ │ │ ┌────────────────┐ │ │ │ │
│ │ │ │ │ │ │ │ │ │
└────────┘ │ │ │ │ │ └─────────────┘ │
│ │ │ │ │ │
│ TCP/IP │ │ │ │ │
└─────────┼──┤ ├───────┘ │
│ │ Listner │ UNIX Socket │
│ │ │ │
┌─────────┼──┤ ├────────┐ │
│ │ │ │ │ │
│ │ │ │ │ ┌─────────────┐ │
┌────────┐ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ Dispatcher │ │
│ │ │ │ └────────────────┘ │ │ │ │
│Client ├──────────┘ │ └────────► │ │
│ │ │ │ │ │
│ │ │ │ │ │
└────────┘ │ └─────────────┘ │
│ │
│ │
│ │
│ │
│ │
│ │
└─────────────────────────────────────────────────────────┘
mkdir build && cd build && cmake ..
../scripts/genkey.sh
./mylsnr -a ca-web.crt -c dispatcher.crt -k dispatcher.key -p ./
From another console run the client example.
./myclnt