aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-uws/src/ClientApp.h
blob: d8696373e1e4e1555bb34533cddbdc4f4a34e996 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "MoveOnlyFunction.h"
#include "WebSocketContext.h"
#include <string>

namespace uWS {

    struct WebSocketClientBehavior {
        MoveOnlyFunction<void()> open;
        MoveOnlyFunction<void()> message;
        MoveOnlyFunction<void()> close;
        //MoveOnlyFunction<void()> failed;

    };

    struct ClientApp {

        WebSocketContext<0, false, int> *webSocketContext;
        // behöver ett nytt http context med minimal klient, som slår om till den riktiga websocketcontext
        // om samma storlek på httpsocket och websocket blir det enkel övergång

        ClientApp(WebSocketClientBehavior &&behavior) {
            //webSocketContext = WebSocketContext<0, false, int>::create();
        }

        ClientApp &&connect(std::string url, std::string protocol = "") {

            return std::move(*this);
        }

        void run() {

        }

    };

}