public bool Connect(IPAddress ip, int port) { if (network != null) { return(false); } network = new ClientNetwork(ip, port); network.NetworkHandler = this; return(network.ConnectAsync()); }
public void Dispose() { OnNetConnecting = null; OnNetConnected = null; OnNetDisconnecting = null; OnNetDisconnected = null; OnNetError = null; if (network != null) { network.Disconnect(); network = null; } ProcessReset(); }