aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/remote_server_connection.h
blob: 63d7f2064605d9c1cdb365404176997dd8728089 (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
#pragma once

#include "session_impl.h"

#include <util/generic/object_counter.h>

namespace NBus {
    namespace NPrivate {
        class TRemoteServerConnection: public TRemoteConnection {
            friend struct TBusSessionImpl;
            friend class TRemoteServerSession;

            TObjectCounter<TRemoteServerConnection> ObjectCounter;

        public:
            TRemoteServerConnection(TRemoteServerSessionPtr session, ui64 id, TNetAddr addr);

            void Init(SOCKET socket, TInstant now);

            inline TRemoteServerSession* GetSession();

            void HandleEvent(SOCKET socket, void* cookie) override;

            bool NeedInterruptRead() override;

            void MessageSent(TArrayRef<TBusMessagePtrAndHeader> messages) override;

            void ReaderProcessMessageUnknownVersion(TArrayRef<const char> dataRef) override;
        };

    }
}