* Fix critical bugs in session opening for TCP and UDP in case of Singleplex mode.
- In case of TCP, don't open the session in the listener accept thread. This
causes resource exhaustion of the tcp listener backlog queue in case of internet
connection disruption or timeout.
- In case of UDP, don't create a new session for every UDP packet.
* Fix race in integration test.
* Fix race condition in session maker
* Code style improvements
* Explicit session.Close() call is indeed needed
Co-authored-by: Andy Wang <cbeuw.andy@gmail.com>
* Fix termination of long downloads after StreamTimeout seconds.
- Even if not broadcasting in a loop, we still need to update the read deadline.
- Don't enforce the timeout after the first data is written.
* When timeout no longer needs to be enforced, no need to schedule a broadcast.
* Fix Cloak client. Don't enforce read deadline after first read.
* Enforce StreamTimeout on the initial bytes sent by localConn only.
* Revert changes to multiplex module. Remove timeout from caller.