Remove global state for ICE TCP

This addresses a few points issue of #245:

 - Take a net.Listener instead of having global state
 - Expose a net.TCPMux based API

Also, the unused closeChannel was removed from tcp_mux.go

Closes #253.
This commit is contained in:
Jerko Steiner
2020-07-19 15:20:11 +02:00
parent 5d2bbc818c
commit 3b9a989177
9 changed files with 164 additions and 176 deletions

View File

@@ -103,6 +103,9 @@ var (
// ErrRunCanceled indicates a run operation was canceled by its individual done
ErrRunCanceled = errors.New("run was canceled by done")
// ErrTCPMuxNotInitialized indicates TCPMux is not initialized and that invalidTCPMux is used.
ErrTCPMuxNotInitialized = errors.New("TCPMux is not initialized")
// ErrTCPRemoteAddrAlreadyExists indicates we already have the connection with same remote addr.
ErrTCPRemoteAddrAlreadyExists = errors.New("conn with same remote addr already exists")
)