pub unsafe trait VZVirtioSocketListenerDelegate: NSObjectProtocol {
// Provided method
unsafe fn listener_shouldAcceptNewConnection_fromSocketDevice(
&self,
listener: &VZVirtioSocketListener,
connection: &VZVirtioSocketConnection,
socket_device: &VZVirtioSocketDevice,
) -> bool
where Self: Sized + Message { ... }
}VZVirtioSocketListener only.Expand description
Delegate object for VZVirtioSocketListener.
A class conforming to VZVirtioSocketListenerDelegate protocol can provide a method to establish a new connection to the socket.
See: VZVirtioSocketDevice
See: VZVirtioSocketListener
See: VZVirtioSocketConnection
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn listener_shouldAcceptNewConnection_fromSocketDevice(
&self,
listener: &VZVirtioSocketListener,
connection: &VZVirtioSocketConnection,
socket_device: &VZVirtioSocketDevice,
) -> bool
Available on crate features VZSocketDevice and VZVirtioSocketConnection and VZVirtioSocketDevice only.
unsafe fn listener_shouldAcceptNewConnection_fromSocketDevice( &self, listener: &VZVirtioSocketListener, connection: &VZVirtioSocketConnection, socket_device: &VZVirtioSocketDevice, ) -> bool
VZSocketDevice and VZVirtioSocketConnection and VZVirtioSocketDevice only.Invoked when the Virtio socket device is accepting a new connection.
Parameter listener: The listener invoking the delegate method.
Parameter connection: The new connection to be established.
Parameter socketDevice: The Virtio socket device with which the new connection is to be established.
Returns: YES if the connection should be established, NO otherwise.
The VZVirtioSocketConnection object owns a file descriptor for this connection. Data can be sent and received through that file descriptor. If the connection is accepted, the implementation should keep a reference to the connection object to send and receive data.