#include <WSInfoSub.h>
Definition at line 18 of file WSInfoSub.h.
◆ pointer
◆ wptr
◆ ref
◆ Consumer
◆ WSInfoSub()
◆ user()
◆ forwardedFor()
◆ send()
| void xrpl::WSInfoSub::send |
( |
json::Value const & | jv, |
|
|
bool | ) |
|
overridevirtual |
◆ getConsumer()
◆ getSeq()
◆ totalSubscriptionCount()
| std::size_t xrpl::InfoSub::totalSubscriptionCount |
( |
| ) |
const |
|
nodiscardinherited |
Return the number of subscriptions currently tracked on this connection.
The combined size of the per-connection account, real-time account, and account-history subscription sets. doSubscribe reads this to enforce the per-connection subscription cap before admitting more.
- Returns
- The total tracked subscription count for this connection.
- Note
- Thread-safe: takes lock_ for the read; read-only.
Definition at line 149 of file libxrpl/server/InfoSub.cpp.
◆ tryReserveAccountSubscriptions()
Enforce the cap and reserve a request's net-new accounts, atomically.
Under one hold of lock_: count the net-new entries in the two sets, check the total against cap, and insert them only if it fits. All-or-nothing. Doing check and insert together stops two concurrent requests sharing an InfoSub (the admin subscribe-by-url path) from both passing the check before either records its accounts. The server-side maps are populated afterwards by subAccount, whose re-insert is a no-op.
- Parameters
-
| proposedAccounts | Real-time (accounts_proposed) ids to reserve. |
| normalAccounts | Normal (accounts) ids to reserve. |
| cap | The effective per-connection cap. |
- Returns
- true if reserved; false if the request must be rejected.
- Note
- Thread-safe: takes lock_.
Definition at line 161 of file libxrpl/server/InfoSub.cpp.
◆ hasAccountHistorySubscription()
| bool xrpl::InfoSub::hasAccountHistorySubscription |
( |
AccountID const & | account | ) |
const |
|
nodiscardinherited |
Whether this connection already tracks an account-history for account.
doSubscribe reads this to charge the cap for an account_history_tx_stream only when it is net-new, matching the account branches.
- Parameters
-
| account | The account an account_history_tx_stream would add. |
- Returns
- true if
account is already in the account-history set.
- Note
- Thread-safe: takes lock_; read-only.
Definition at line 240 of file libxrpl/server/InfoSub.cpp.
◆ onSendEmpty()
| void xrpl::InfoSub::onSendEmpty |
( |
| ) |
|
|
inherited |
◆ insertSubAccountInfo()
| void xrpl::InfoSub::insertSubAccountInfo |
( |
AccountID const & | account, |
|
|
bool | rt ) |
|
inherited |
◆ deleteSubAccountInfo()
| void xrpl::InfoSub::deleteSubAccountInfo |
( |
AccountID const & | account, |
|
|
bool | rt ) |
|
inherited |
◆ insertBookSubscription()
| void xrpl::InfoSub::insertBookSubscription |
( |
Book const & | book | ) |
|
|
inherited |
Record that this subscriber is following book.
Called by NetworkOPsImp::subBook so that ~InfoSub() can issue a matching unsubBook for every book this subscriber is tracking, keeping per-subscriber state symmetric with the server-side map.
- Parameters
-
| book | The order book this subscriber has just subscribed to. |
- Note
- Idempotent: re-inserting an already-tracked book is a no-op.
-
Thread-safe: takes InfoSub::lock_.
Definition at line 247 of file libxrpl/server/InfoSub.cpp.
◆ deleteBookSubscription()
| void xrpl::InfoSub::deleteBookSubscription |
( |
Book const & | book | ) |
|
|
inherited |
Stop tracking book for this subscriber.
Called by the unsubscribe RPC handler so that the book is not re-unsubscribed by ~InfoSub(). Pairs with insertBookSubscription.
- Parameters
-
| book | The order book to forget. |
- Note
- No-op if
book was not previously inserted.
-
Thread-safe: takes InfoSub::lock_.
Definition at line 254 of file libxrpl/server/InfoSub.cpp.
◆ insertSubAccountHistory()
| bool xrpl::InfoSub::insertSubAccountHistory |
( |
AccountID const & | account | ) |
|
|
inherited |
◆ deleteSubAccountHistory()
| void xrpl::InfoSub::deleteSubAccountHistory |
( |
AccountID const & | account | ) |
|
|
inherited |
◆ clearRequest()
| void xrpl::InfoSub::clearRequest |
( |
| ) |
|
|
inherited |
◆ setRequest()
◆ getRequest()
◆ setApiVersion()
| void xrpl::InfoSub::setApiVersion |
( |
unsigned int | apiVersion | ) |
|
|
inherited |
◆ getApiVersion()
| unsigned int xrpl::InfoSub::getApiVersion |
( |
| ) |
const |
|
nodiscardnoexceptinherited |
◆ assignId()
| int xrpl::InfoSub::assignId |
( |
| ) |
|
|
staticprivateinherited |
◆ getCounter()
|
|
staticprivatenoexceptinherited |
◆ ws_
◆ user_
◆ fwdfor_
◆ lock_
|
|
mutableprotectedinherited |
◆ consumer_
◆ source_
| Source& xrpl::InfoSub::source_ |
|
privateinherited |
◆ realTimeSubscriptions_
◆ normalSubscriptions_
◆ request_
◆ seq_
◆ accountHistorySubscriptions_
◆ bookSubscriptions_
◆ apiVersion_
| unsigned int xrpl::InfoSub::apiVersion_ = 0 |
|
privateinherited |
◆ Object