Skip to content

Commit 788d0eb

Browse files
committed
add context::handleInitialConnection as entrace (unused)
Signed-off-by: Emelia Lei <[email protected]>
1 parent 8beed8d commit 788d0eb

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,27 @@ int InitialConnectionContext::scheduleRead(bsl::ostream& errorDescription)
521521
return rc_SUCCESS;
522522
}
523523

524+
void InitialConnectionContext::handleInitialConnection()
525+
{
526+
if (!isIncoming()) {
527+
// TODO: When we are ready to move on to the next step, we should
528+
// call `authenticationOutbound` here instead before calling
529+
// `negotiateOutbound`.
530+
handleEvent(0,
531+
bsl::string(),
532+
mqbnet::InitialConnectionEvent::e_OUTBOUND_NEGOTATION);
533+
}
534+
else {
535+
bmqu::MemOutStream errStream;
536+
const int rc = scheduleRead(errStream);
537+
if (rc != 0) {
538+
handleEvent(rc,
539+
errStream.str(),
540+
mqbnet::InitialConnectionEvent::e_ERROR);
541+
}
542+
}
543+
}
544+
524545
void InitialConnectionContext::handleEvent(
525546
int statusCode,
526547
const bsl::string& errorDescription,

src/groups/mqb/mqbnet/mqbnet_initialconnectioncontext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ class InitialConnectionContext
383383
/// `errorDescription` with details on failure.
384384
int scheduleRead(bsl::ostream& errorDescription);
385385

386+
/// Entrance to the initial connection process.
387+
void handleInitialConnection();
388+
386389
/// Process a handshake event with the given `statusCode` and
387390
/// `errorDescription`. The `input` specifies the event type, and
388391
/// `message` contains any associated control message data.

0 commit comments

Comments
 (0)