private static long PingServer(string host, ushort port) { var watch = Stopwatch.StartNew(); var client = TCPClientWrapper.Create(); client.Connect(host, port); client.Disconnect(); watch.Stop(); return(watch.ElapsedMilliseconds); }
public Protocol(MineLibClient client, ProtocolPurpose purpose) : base(client, purpose) { Stream = new ProtobufStream(TCPClientWrapper.Create()); RegisterSupportedSendings(); //ModAPIs var modules = AssemblyParser.GetAssemblyInfos("Forge*.dll"); if (modules.Any()) { foreach (var module in modules) { LoadForgeModAPI(module); } } else { LoadForgeModAPI(new AssemblyInfo("NONE")); } }