mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Fixed typo in example code
This commit is contained in:
@ -183,11 +183,11 @@ pc.onGatheringStateChange([](PeerConnection::GatheringState state) {
|
|||||||
```cpp
|
```cpp
|
||||||
auto dc = pc.createDataChannel("test");
|
auto dc = pc.createDataChannel("test");
|
||||||
|
|
||||||
dc.onOpen([]() {
|
dc->onOpen([]() {
|
||||||
cout << "Open" << endl;
|
cout << "Open" << endl;
|
||||||
});
|
});
|
||||||
|
|
||||||
dc.onMessage([](variant<binary, string> message) {
|
dc->onMessage([](variant<binary, string> message) {
|
||||||
if (holds_alternative<string>(message)) {
|
if (holds_alternative<string>(message)) {
|
||||||
cout << "Received: " << get<string>(message) << endl;
|
cout << "Received: " << get<string>(message) << endl;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user