class Connection
Defined at line 189 of file ../../src/devices/misc/drivers/virtio-socket/socket.h
Public Methods
void ~Connection ()
Defined at line 228 of file ../../src/devices/misc/drivers/virtio-socket/socket.h
void Connection (const ConnectionKey & key, zx::socket data, SignalHandler wait_handler, uint32_t cid, std::mutex & lock)
Defined at line 787 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool PendingTx ()
Defined at line 810 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool IsShuttingDown ()
Whether or not the connection is in the process of closing.
Defined at line 817 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool BeginShutdown ()
Tell the connection to begin a client requested graceful shutdown.
This means we will drain any pending TX before completing the shutdown.
Defined at line 822 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool NotifyVmoTxComplete (uintptr_t paddr)
Informs the connection that a TX has completed that was sending the
specified |paddr|. This returns 'true' to indicate the current VMO has
completed sending.
Defined at line 832 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
void UpdateCredit (uint32_t buf, uint32_t fwd)
Defined at line 841 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
void MakeActive (async_dispatcher_t * disp)
Marks a connection as active and able to send/receive data. Is ignored
if the connection is shutting down.
Defined at line 846 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool Rx (void * data, size_t len)
Receive data on the connection. Returns false if there is a client error
and the connection should be RST.
Defined at line 855 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
void UpdateTxThreshold ()
Evaluates if we have enough credits to continue receiving data and
schedules a later update to credit info if not.
Defined at line 865 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
CreditInfo ContinueRx (async_dispatcher_t * disp)
Analogous to ContinueTx, ContinueRx acknowledges the observation of the
ZX_SOCKET_WRITE_THRESHOLD signal and clears the threshold value before
starting a new wait on `disp`.
Defined at line 872 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
CreditInfo GetCreditInfo ()
Returns the credit information for this connection.
Defined at line 899 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
virtio_vsock_hdr_t MakeHdr (uint16_t op)
Helper for making a header that is filled out with our connection key
and credit information.
Defined at line 917 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
void Close (async_dispatcher_t * dispatcher)
Close a connection indicating no more data shall be sent and received and
it should enter the zombie state until it gets fully deleted.
Defined at line 921 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
zx_status_t ContinueTx (bool force_credit_request, TxIoBufferRing & tx, async_dispatcher_t * dispatcher)
Performs any outstanding TX for this connection by filling the providing
ring with descriptors. This may generate credit requests and HasPendingOp
can be checked afterwards to see if this is the case. This returns
ZX_OK if there is no more pending tx, ZX_ERR_SHOULD_WAIT if there is
still data to send and we should retry when there is either more credit
or more TX descriptors. Any other return status indicates an underlying
transport error and the connection should be closed.
Defined at line 932 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
zx_status_t SetVmo (zx::bti & bti, zx::vmo vmo, uint64_t offset, uint64_t len, uint64_t bti_contiguity)
Defined at line 950 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
void QueueOp (uint16_t new_op)
Defined at line 963 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
bool HasPendingOp ()
Defined at line 989 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
uint16_t TakePendingOp ()
Defined at line 990 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
size_t GetHash (const ConnectionKey & addr)
Defined at line 996 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc
const ConnectionKey & GetKey ()
Defined at line 1000 of file ../../src/devices/misc/drivers/virtio-socket/socket.cc