Create a pair of connections that are talking to each other, e.g. a loopback connection.
This is very useful for testing, or so that your client/server code can work the same
even when you are running a local "server".
The two connections will immediately be placed into the connected state, and no callbacks
will be posted immediately. After this, if you close either connection, the other connection
will receive a callback, exactly as if they were communicating over the network. You must
close *both* sides in order to fully clean up the resources!
By default, internal buffers are used, completely bypassing the network, the chopping up of
messages into packets, encryption, copying the payload, etc. This means that loopback
packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will
cause the socket pair to send packets through the local network loopback device (127.0.0.1)
on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended
to encrypt and decrypt.
If you wish to assign a specific identity to either connection, you may pass a particular
identity. Otherwise, if you pass nullptr, the respective connection will assume a generic
"localhost" identity. If you use real network loopback, this might be translated to the
actual bound loopback port. Otherwise, the port will be zero.
Create a pair of connections that are talking to each other, e.g. a loopback connection. This is very useful for testing, or so that your client/server code can work the same even when you are running a local "server".
The two connections will immediately be placed into the connected state, and no callbacks will be posted immediately. After this, if you close either connection, the other connection will receive a callback, exactly as if they were communicating over the network. You must close *both* sides in order to fully clean up the resources!
By default, internal buffers are used, completely bypassing the network, the chopping up of messages into packets, encryption, copying the payload, etc. This means that loopback packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will cause the socket pair to send packets through the local network loopback device (127.0.0.1) on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended to encrypt and decrypt.
If you wish to assign a specific identity to either connection, you may pass a particular identity. Otherwise, if you pass nullptr, the respective connection will assume a generic "localhost" identity. If you use real network loopback, this might be translated to the actual bound loopback port. Otherwise, the port will be zero.