Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Latest commit

 

History

History
63 lines (45 loc) · 2.02 KB

File metadata and controls

63 lines (45 loc) · 2.02 KB

Simple-WebSocket-Sample

This project contains two executables which allow the user to control the connections and message flow for Simple-WebSocket-Server. It might be useful for testing interoperability with other websockets implementations.

sample_server controls

s :  Start server
t :  sTop server
m :  send Message to all clients
q :  Quit

sample_client controls

s :  Set up connection
l :  cLose connection
c :  stop Client
m :  send Message
q :  Quit

Usage

Run one server and as many clients as you like. Type the letter for the desired action and hit enter. A typical session might look like this:

sample_client sample_server Effect
Start The server starts listening for connections
Start The client connects to the server
Message The client sends a message to the server (the server will respond with an echo)
Message The server sends a message to all connected clients (they will not respond)
cLose The client disconnects with a message
sTop The server stops listening
sTop The client cleans itself up
Quit The client quits
Quit The server quits

Building

The sample uses Simple-WebSocket-Server (duh). You'll need its dependencies installed.

Windows

Populate the following environmentla variables:

variable value
BoostRoot C:\path\to\Boost
BoostVer 1_62
OpenSSLRoot C:\path\to\OpenSSL

Specify the correct generator in your call to cmake, this example uses 2017 with a 64 bit build:

mkdir build
cd build
cmake .. -G "Visual Studio 15 2017 Win64"

Open in your IDE of choice build/Simple_WebSocket_Sample.sln and build it.

Linux

mkdir build
cd build 
cmake ..