TCPConnection constructor
TCPConnection(
- Socket _socket,
- MultiAddr _localAddr,
- MultiAddr _remoteAddr,
- PeerId _localPeerId,
- PeerId? _remotePeerId,
- ResourceManager _resourceManager,
- bool _isServer, {
- ConnManager? legacyConnManager,
Creates a new raw TCP connection.
Implementation
TCPConnection(
this._socket,
this._localAddr,
this._remoteAddr,
this._localPeerId,
this._remotePeerId, // Can be null for incoming raw connections before handshake
// this._multiplexer, // Removed
this._resourceManager, // Kept for now
this._isServer, {
// this.onIncomingStream, // Removed
ConnManager? legacyConnManager,
}) : _id = Uuid().v4(),
_legacyConnManager = legacyConnManager,
_direction = _isServer ? Direction.inbound : Direction.outbound {
_log.fine('TCPConnection($_id) CREATED. IsServer: $_isServer, Direction: $_direction. Socket Local: ${_socket.address.address}:${_socket.port}, Socket Remote: ${_socket.remoteAddress.address}:${_socket.remotePort}');
this._legacyConnManager?.registerConnection(this);
}