static void Benchmark() { ProtoConnection c = new ProtoConnection (new IPEndPoint (IPAddress.Parse ("127.0.0.1"), 9001)); c.Connect (true); for (int i = 0; i < 100000; i++) { ListResponse fl = c.Write<ListResponse> (c.CreateBuilder () .SetListRequest (ListRequest.CreateBuilder () .SetPath ("/") .Build ()) .Build ()); logger.Log (i % 1000 == 0 ? NLog.LogLevel.Info : NLog.LogLevel.Debug, fl.GetFile (0)); } }
public void Connect(string user, string password) { conn = new Connection (new IPEndPoint (IPAddress.Parse ("127.0.0.1"), 9001)); conn.Connect (true); logger.Info ("Connected", user, password); new Thread (() => { VFSConsumer c = new FUSEConsumer (); AppDomain.CurrentDomain.ProcessExit += (s, e) => { logger.Debug ("Process exiting"); c.Stop (); }; c.Start (new NetProvider (conn), opts); logger.Debug ("Finished"); }).Start (); }