You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+53-18
Original file line number
Diff line number
Diff line change
@@ -5,33 +5,68 @@ IXWebSocket is a C++ library for WebSocket client and server development. It has
5
5
It is been used on big mobile video game titles sending and receiving tons of messages since 2017 (iOS and Android). It was tested on macOS, iOS, Linux, Android, Windows and FreeBSD. Two important design goals are simplicity and correctness.
6
6
7
7
```cpp
8
+
/*
9
+
* main.cpp
10
+
* Author: Benjamin Sergeant
11
+
* Copyright (c) 2020 Machine Zone, Inc. All rights reserved.
12
+
*
13
+
* Super simple standalone example. See ws folder, unittest and doc/usage.md for more.
14
+
*
15
+
* On macOS
16
+
* $ mkdir -p build ; cd build ; cmake -DUSE_TLS=1 .. ; make -j ; make install
// Now that our callback is setup, we can start our background thread and receive messages
54
+
webSocket.start();
29
55
30
-
// Now that our callback is setup, we can start our background thread and receive messages
31
-
webSocket.start();
56
+
// Send a message to the server (default to TEXT mode)
57
+
webSocket.send("hello world");
58
+
59
+
while (true)
60
+
{
61
+
std::string text;
62
+
std::cout << "> " << std::flush;
63
+
std::getline(std::cin, text);
64
+
65
+
webSocket.send(text);
66
+
}
32
67
33
-
// Send a message to the server (default to TEXT mode)
34
-
webSocket.send("hello world");
68
+
return 0;
69
+
}
35
70
```
36
71
37
72
Interested? Go read the [docs](https://machinezone.github.io/IXWebSocket/)! If things don't work as expected, please create an issue on GitHub, or even better a pull request if you know how to fix your problem.
0 commit comments