// This file is provided under The MIT License as part of RiptideNetworking.
// Copyright (c) Tom Weiland
// For additional information please see the included LICENSE.md file or view it on GitHub:
// https://github.com/RiptideNetworking/Riptide/blob/main/LICENSE.md
using System;
namespace Riptide.Transports
{
/// Defines methods, properties, and events which every transport's client must implement.
public interface IClient : IPeer
{
/// Invoked when a connection is established at the transport level.
event EventHandler Connected;
/// Invoked when a connection attempt fails at the transport level.
event EventHandler ConnectionFailed;
/// Starts the transport and attempts to connect to the given host address.
/// The host address to connect to.
/// The pending connection. if an issue occurred.
/// The error message associated with the issue that occurred, if any.
/// if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made.
bool Connect(string hostAddress, out Connection connection, out string connectError);
/// Closes the connection to the server.
void Disconnect();
}
}