Fix for the read ready event on local networking which was missing events on new connections in certain race conditions

This commit is contained in:
Johnathan Sharratt
2023-01-19 11:08:31 +11:00
parent 27d020dce4
commit 67a1a89f8c
11 changed files with 95 additions and 228 deletions

View File

@@ -197,9 +197,6 @@ pub struct SocketReceiveFrom {
#[async_trait::async_trait]
pub trait VirtualTcpListener: fmt::Debug + Send + Sync + 'static {
/// Checks how many sockets are waiting to be accepted
async fn peek(&mut self) -> Result<usize>;
/// Tries to accept a new connection
fn try_accept(&mut self) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>;
@@ -341,9 +338,6 @@ pub trait VirtualConnectedSocket: VirtualSocket + fmt::Debug + Send + Sync + 'st
/// Recv a packet from the socket
fn try_recv(&mut self) -> Result<Option<SocketReceive>>;
/// Peeks for a packet from the socket
async fn peek(&mut self) -> Result<SocketReceive>;
}
/// Connectionless sockets are able to send and receive datagrams and stream