Esempio n. 1
0
 public bool Start()
 {
     try
     {
         Client.Connect(Details.Server, Details.ServerPort);
         Streams = new StreamCollection(Client.GetStream());
         RawBuffer("PASS {0}", Details.Password);
         RawBuffer("NICK {0}", Details.Username);
         FlushBuffer();
         if (!Streams.InputStream.ReadLine().ToLower().Contains("welcome"))
         {
             return(false);
         }
         Connected = true;
         SendRaw("JOIN {0}", Details.Channel);
         HandleStreamReading();
         Heartbeat();
         return(true);
     }
     catch (Exception ex)
     {
         LastError = ex;
         return(false);
     }
 }
Esempio n. 2
0
 public bool Start()
 {
     try
     {
         Client.Connect(Details.Server, Details.ServerPort);
         Streams = new StreamCollection(Client.GetStream());
         RawBuffer("PASS {0}", Details.Password);
         RawBuffer("NICK {0}", Details.Username);
         FlushBuffer();
         if (!Streams.InputStream.ReadLine().ToLower().Contains("welcome"))
             return false;
         Connected = true;
         SendRaw("JOIN {0}", Details.Channel);
         HandleStreamReading();
         Heartbeat();
         return true;
     }
     catch (Exception ex)
     {
         LastError = ex;
         return false;
     }
 }