aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/remote_server_connection.h
blob: c4f6dbf33d33f21547bf520bb96be63c8920a04b (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;
        };

    }
}