Error: connect() already called

I could reproduce the error. When two producers or consumers are created at the same time and over the same transport in the client side then the transport.on('connect') event is fired twice. Thus, two simultaneous requests are sent to the server and as a result, dual call to the transport.connect() happens.

However the two producers/consumers are connected successfully but better to avoid this somehow, by checking the previous calls to the transport for instance. Checking the transport.dtlsState, as I mentioned before, won’t help in this scenario.