aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/remote_server_session.h
blob: 5de07c4e59d0958d02f8846954e1166617d085de (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "remote_server_session_semaphore.h"
#include "session_impl.h"

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4250) //  'NBus::NPrivate::TRemoteClientSession' : inherits 'NBus::NPrivate::TBusSessionImpl::NBus::NPrivate::TBusSessionImpl::GetConfig' via dominance 
#endif

namespace NBus { 
    namespace NPrivate { 
        class TRemoteServerSession: public TBusServerSession, public TBusSessionImpl { 
            friend class TRemoteServerConnection; 

        private: 
            TObjectCounter<TRemoteServerSession> ObjectCounter; 

            TRemoteServerSessionSemaphore ServerOwnedMessages; 
            IBusServerHandler* const ServerHandler; 

        public: 
            TRemoteServerSession(TBusMessageQueue* queue, TBusProtocol* proto, 
                                 IBusServerHandler* handler, 
                                 const TBusSessionConfig& config, const TString& name); 

            void OnMessageReceived(TRemoteConnection* c, TVectorSwaps<TBusMessagePtrAndHeader>& newMsg) override; 
            void InvokeOnMessage(TBusMessagePtrAndHeader& request, TIntrusivePtr<TRemoteServerConnection>& conn); 

            EMessageStatus SendReply(const TBusIdentity& ident, TBusMessage* pRep) override; 

            EMessageStatus ForgetRequest(const TBusIdentity& ident) override; 

            int GetInFlight() const noexcept override; 
            void FillStatus() override; 

            void Shutdown() override; 

            void PauseInput(bool pause) override; 
            unsigned GetActualListenPort() override; 

            void AcquireInWorkRequests(TArrayRef<const TBusMessagePtrAndHeader> requests); 
            void ReleaseInWorkResponses(TArrayRef<const TBusMessagePtrAndHeader> responses); 
            void ReleaseInWorkRequests(TRemoteConnection&, TBusMessage*); 
            void ReleaseInWork(TBusIdentity&); 
            void ConvertInWork(TBusIdentity& req, TBusMessage* reply); 
        }; 

#ifdef _MSC_VER
#pragma warning(pop)
#endif

    } 
}