TCPConnection constructor

TCPConnection(
  1. Socket _socket,
  2. MultiAddr _localAddr,
  3. MultiAddr _remoteAddr,
  4. PeerId _localPeerId,
  5. PeerId? _remotePeerId,
  6. ResourceManager _resourceManager,
  7. bool _isServer, {
  8. 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);
}