DistributedConnection constructor

DistributedConnection()
Create a new distributed connection. Socket to transfer data through. Working domain. Username. Password. Create a new instance of a distributed connection

Implementation

/*
DistributedConnection.connect(
    ISocket socket, String domain, String username, String password) {
  _session =
      new Session(new ClientAuthentication(), new HostAuthentication());

  _session.localAuthentication.method = AuthenticationMethod.Credentials;
  _session.localAuthentication.domain = domain;
  _session.localAuthentication.username = username;

  _localPasswordOrToken = DC.stringToBytes(password);

  init();

  assign(socket);
}

DistributedConnection.connectWithToken(
    ISocket socket, String domain, int tokenIndex, String token) {
  _session =
      new Session(new ClientAuthentication(), new HostAuthentication());

  _session.localAuthentication.method = AuthenticationMethod.Token;
  _session.localAuthentication.domain = domain;
  _session.localAuthentication.tokenIndex = tokenIndex;

  _localPasswordOrToken = DC.stringToBytes(token);

  init();

  assign(socket);
}
*/

/// <summary>
/// Create a new instance of a distributed connection
/// </summary>
DistributedConnection() {
  //myId = Global.GenerateCode(12);
  // localParams.Host = DistributedParameters.HostType.Host;
  _session =
      new Session(new HostAuthentication(), new ClientAuthentication());
  init();
}