The `sender` was, previously, somewhat mislabeled. It was a combination
of PID and TID, except when it wasn't.
Instead, make this value a combination of ConnectionID and queue index.
This makes it easier to reason about which connection we're responding
to.
Additionally, don't expose teh global Server Index Table to userspace
programs.
Signed-off-by: Sean Cross <sean@xobs.io>
This is used when creating a new Server. In addition to the ServerID, it
also returns the ConnectionID. This is the ID that can be expected when
receiving messages.
Signed-off-by: Sean Cross <sean@xobs.io>
This fixes issue #1, which correctly noted the comment was correct but
the code implementation was not correct.
Signed-off-by: Sean Cross <sean@xobs.io>
This ensures that these messages aren't leaked. In a native system, this
memory would be "freed" by the kernel as it is attached to the new
memory space.
Signed-off-by: Sean <xobs@ci.betrusted.io>
When converting into a message, the associated memory should be leaked
and not freed when the Carton is dropped. This is because the Message
can outlive the MemoryMessage, and the Carton is then immediately
dropped.
Signed-off-by: Sean <xobs@ci.betrusted.io>
Previously, each process could return one chunk of memory. With this
change, processes can now return one chunk of memory per thread. This
enables multiple threads to lend memory to a server.
Signed-off-by: Sean <xobs@ci.betrusted.io>
With the introduction of TrySendMessage, the kernel needs to know that
this data structure should be transmitted over the wire in the same
manner as SendMessage. Previously it was not special-casing this, which
resulted in memory errors.
Signed-off-by: Sean <xobs@ci.betrusted.io>
When the message coming in from the client to a server changes, print
an informative message rather than just "left != right".
Signed-off-by: Sean <xobs@ci.betrusted.io>
When running on Linux, attempting to shut down a network socket that
has already been closed results in an error. That is, if the client
disconnects, then the server will throw an error when it also attempts
to disconnect.
Ignore errors to `.shutdown()` to fix `cargo test` on Linux.
Signed-off-by: Sean Cross <sean@xobs.io>