public NetChannel(NetSystem net, NetAddress address, int qport, int maxMessageLength) { this.net = net; this.Address = address; this.qport = qport; this.maxMessageLength = maxMessageLength; this.fragmentBuffer = new byte[this.maxMessageLength]; this.unsentBuffer = new byte[this.maxMessageLength]; }
internal NetClient(INetHandler netHandler) { if (netHandler == null) { throw new JKClientException(new ArgumentNullException(nameof(netHandler))); } this.net = new NetSystem(); this.NetHandler = netHandler; this.packetReceived = new byte[this.NetHandler.MaxMessageLength]; }
public async Task <IEnumerable <ServerInfo> > GetNewList() { this.getListTCS?.TrySetCanceled(); this.getListTCS = new TaskCompletionSource <IEnumerable <ServerInfo> >(); this.globalServers.Clear(); foreach (var masterServer in this.masterServers) { var address = NetSystem.StringToAddress(masterServer.Name, masterServer.Port); if (address == null) { continue; } this.OutOfBandPrint(address, $"getservers {this.Protocol}"); } this.serverRefreshTimeout = Common.Milliseconds + ServerBrowser.RefreshTimeout; return(await this.getListTCS.Task); }
public async Task <IEnumerable <ServerInfo> > GetNewList() { this.serverRefreshTimeout = Common.Milliseconds + ServerBrowser.RefreshTimeout; this.getListTCS?.TrySetCanceled(); this.getListTCS = new TaskCompletionSource <IEnumerable <ServerInfo> >(); this.globalServers.Clear(); foreach (var masterServer in this.masterServers) { var address = NetSystem.StringToAddress(masterServer.Name, masterServer.Port); if (address == null) { continue; } foreach (ProtocolVersion protocol in Enum.GetValues(typeof(ProtocolVersion))) { if (protocol == ProtocolVersion.Unknown) { continue; } this.OutOfBandPrint(address, $"getservers {protocol.ToString("d")}"); } } return(await this.getListTCS.Task); }
public NetChannel(NetSystem net, NetAddress address, int qport) { this.net = net; this.Address = address; this.qport = qport; }
internal NetClient() { this.net = new NetSystem(); }
public static NetAddress FromString(string address) { return(NetSystem.StringToAddress(address)); }