MixnetClient can send ClientRequests #5381
Open
+112
−50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ended up adding another channel to the
MixnetClient
, so that it can signal to theMixTrafficController
that can send aClientRequest
via itsGatewayTransciver
.Had to add a sleep to the
disconnect
call as the socket would close before the channel message got processed, briefly considered adding anack
channel so that we can signal back when the message got sent, but opted for simplicity for now. I've also bumped the default timeout to 10 secs.Looking at this code, I'm not sure if channels between MixnetClient and MixTrafficController are needed, since messages are processed serially, we might be able to pass an
Arc<Mutex<MixTrafficController>>
to MixnetClient and use it directly, remove a level of indirection from the code, nothing actionable now just shower thoughts...This change is