assign method

void assign(
  1. ISocket socket
)
override
Assign a socket to the connection. Any socket that implements ISocket.

Implementation

assign(ISocket socket) {
  super.assign(socket);

  _session?.remoteAuthentication.source
      ?.attributes[SourceAttributeType.IPv4] = socket.remoteEndPoint?.address;
  _session?.remoteAuthentication.source
      ?.attributes[SourceAttributeType.Port] = socket.remoteEndPoint?.port;
  _session?.localAuthentication.source?.attributes[SourceAttributeType.IPv4] =
      socket.localEndPoint?.address;
  _session?.localAuthentication.source?.attributes[SourceAttributeType.Port] =
      socket.localEndPoint?.port;

  if (_session?.localAuthentication.type == AuthenticationType.Client) {
    // declare (Credentials -> No Auth, No Enctypt)
    _declare();
  }
}