cultmesh-rs tests: the scripted peer starts a session only on a Connect
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9095a96e6e
commit
d0a28918ce
1 changed files with 7 additions and 3 deletions
|
|
@ -95,9 +95,13 @@ fn serve(socket: UdpSocket, commands: Receiver<PeerCommand>, received: Sender<Cu
|
|||
break found;
|
||||
}
|
||||
};
|
||||
let Ok(packet) = decode_rudp_packet(&wire[..length]) else {
|
||||
let _ = socket.recv_from(&mut wire);
|
||||
continue;
|
||||
// Only a Connect starts a session; whatever else is waiting (a dead session's pings and resends) is dropped.
|
||||
let packet = match decode_rudp_packet(&wire[..length]) {
|
||||
Ok(packet) if packet.packet_type == cultnet_rs::CultNetRudpPacketType::Connect => packet,
|
||||
_ => {
|
||||
let _ = socket.recv_from(&mut wire);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let mut session = CultNetRudpSocketTransportConnection::new(CultNetRudpSocketTransportOptions {
|
||||
media_delivery: None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue