[listener] Don't crash on connection error
This commit is contained in:
parent
8290ec6ab2
commit
96f6b1f8de
|
@ -45,7 +45,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
// TODO: Remove these hardcoded values
|
// TODO: Remove these hardcoded values
|
||||||
Channel = "#sparkletest";
|
Channel = "#sparkletest";
|
||||||
Server = "irc.gnome.org";
|
Server = "irc.gnome.orgf";
|
||||||
|
|
||||||
Client = new IrcClient ();
|
Client = new IrcClient ();
|
||||||
|
|
||||||
|
@ -60,10 +60,10 @@ namespace SparkleLib {
|
||||||
public void Listen ()
|
public void Listen ()
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
Thread = new Thread (
|
||||||
|
new ThreadStart (delegate {
|
||||||
|
|
||||||
Thread = new Thread (
|
try {
|
||||||
new ThreadStart (delegate {
|
|
||||||
|
|
||||||
// Connect to the server
|
// Connect to the server
|
||||||
Client.Connect (new string [] {Server}, Port);
|
Client.Connect (new string [] {Server}, Port);
|
||||||
|
@ -78,16 +78,16 @@ namespace SparkleLib {
|
||||||
|
|
||||||
Client.Disconnect ();
|
Client.Disconnect ();
|
||||||
|
|
||||||
})
|
} catch ( Meebey.SmartIrc4net.ConnectionException e) {
|
||||||
);
|
|
||||||
|
|
||||||
Thread.Start ();
|
Console.WriteLine ("Could not connect: " + e.Message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
|
||||||
Console.WriteLine ("Could not connect: " + e.Message);
|
})
|
||||||
|
);
|
||||||
|
|
||||||
}
|
Thread.Start ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue