コード例 #1
0
 private void SetupLogger()
 {
     //Telepathy.Logger.Log = Logger.Log;
     Telepathy.Logger.Log        = msg => Logger.Log("[Telepathy] " + msg);
     Telepathy.Logger.LogWarning = msg => Logger.Warn("[Telepathy] " + msg);
     Telepathy.Logger.LogError   = msg => Logger.Error("[Telepathy] " + msg);
 }
コード例 #2
0
        bool IServerTransportLayer.Start(int port)
        {
            if (_server == null)
            {
                Logger.Warn("Server transport was never initialized and thus can't be started.");
                return(false);
            }

            return(_server.Start(port));
        }
コード例 #3
0
        bool IClientTransportLayer.Connect(string address, int port)
        {
            if (_client == null)
            {
                Logger.Warn("Client transport was never initialized and thus can't connect.");
                return(false);
            }

            _client.Connect(address, port);
            return(_client.Connected || _client.Connecting);
        }