webrtc/signalling: We get the address when accepting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1412>
This commit is contained in:
Nirbheek Chauhan 2023-12-20 18:18:31 +05:30
parent 63b568f4a0
commit 2d85048925

View file

@ -84,17 +84,8 @@ async fn main() -> Result<(), Error> {
info!("Listening on: {}", addr); info!("Listening on: {}", addr);
while let Ok((stream, _)) = listener.accept().await { while let Ok((stream, address)) = listener.accept().await {
let mut server_clone = server.clone(); let mut server_clone = server.clone();
let address = match stream.peer_addr() {
Ok(address) => address,
Err(err) => {
warn!("Connected peer with no address: {}", err);
continue;
}
};
info!("Accepting connection from {}", address); info!("Accepting connection from {}", address);
if let Some(acceptor) = acceptor.clone() { if let Some(acceptor) = acceptor.clone() {