does transport.close() on server side tiggers close on client side? it looks like its not
im closing server side transport 16 seconds after client connects the webrtc transport
but in client side nothing happens ( dtls state change event )
do i need to signal it to client my self that the transport is closed in server side?
what happens when i close a connected transport in server side?
Always signal to client that a broadcast is closing to perform the clearing of tracks and/or mediastream if it’s a fully close. What’s done server-sided the client has no idea of without signalling.
No it doesn’t trigger the event on client side automatically. There is an event on server side which is transport.on(‘close’), something like that. When that event occurs always notify client side that the transport is closed to take appropriate action on client side.
However the ‘connectionstatechange’ event (kindly verify event name from docs) is fired on client side automatically if you close the transport from server side, attached is the pic. Also you can listen to connection state of underlying peer connection of transport on client side via this event, pic is attached as well: transport.handler._pc.onconnectionstatechange
thank you guys for posting this answers
yes thats right client doesn’t receives anything i need to signal it to client myself
its ok just wanted to make sure its nothing wrong with my code
because i thought client should receive transport close if transport is closed from server side because server can receive dtlsStateChange when client closes the transport.
so its oneway i think.
No, it’s not one way. You don’t want to really on DTLS ALERT message to be received by the remote endpoint when you close the transport in client or server. Such a DTLS message (the one that produces dtlsstatechange event) may not arrive or whatever). Please honor the docs and signal events from client to server and viceversa as documented.