File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/networker/networker/lib/src Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,16 @@ abstract class NetworkerServer<T extends ConnectionInfo> extends NetworkerBase {
4040 }
4141
4242 @protected
43- Channel addClientConnection (T info) {
44- final id = _findAvailableChannel ();
45- if (id == kAnyChannel) return id;
46- _connections[id] = info;
47- _connectController.add ((id, info));
43+ Channel addClientConnection (T info, [Channel ? id]) {
44+ if (id != null ) {
45+ closeConnection (id);
46+ }
47+ final current = id ?? _findAvailableChannel ();
48+ if (current == kAnyChannel) return current;
49+ _connections[current] = info;
50+ _connectController.add ((current, info));
4851 _changeController.add (clientConnections);
49- return id ;
52+ return current ;
5053 }
5154
5255 @protected
You can’t perform that action at this time.
0 commit comments