forked from rsocket/rsocket-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRSocketConnectionEvents.h
More file actions
42 lines (33 loc) · 1.51 KB
/
RSocketConnectionEvents.h
File metadata and controls
42 lines (33 loc) · 1.51 KB
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
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
namespace folly {
class exception_wrapper;
}
namespace rsocket {
// The application should implement this interface to get called-back
// on network events.
class RSocketConnectionEvents {
public:
virtual ~RSocketConnectionEvents() = default;
// This method gets called when the underlying transport is connected to the
// remote side. This does not necessarily mean that the RSocket connection
// will be successful. As an example, the transport might get reconnected
// for an existing RSocketStateMachine. But resumption at the RSocket layer
// might not succeed.
virtual void onConnected() {}
// This gets called when the underlying transport has disconnected. This also
// means the RSocket connection is disconnected.
virtual void onDisconnected(const folly::exception_wrapper&) {}
// This gets called when the RSocketStateMachine is closed. You cant use this
// RSocketStateMachine anymore.
virtual void onClosed(const folly::exception_wrapper&) {}
// This gets called when no more frames can be sent over the RSocket streams.
// This typically happens immediately after onDisconnected(). The streams can
// be resumed after onStreamsResumed() event.
virtual void onStreamsPaused() {}
// This gets called when the underlying transport has been successfully
// connected AND the connection can be resumed at the RSocket layer. This
// typically gets called after onConnected()
virtual void onStreamsResumed() {}
};
}