commit
05edb0dbf4
|
@ -71,14 +71,15 @@ namespace SparkleLib {
|
||||||
Server = server;
|
Server = server;
|
||||||
this.channels.Add (folder_identifier);
|
this.channels.Add (folder_identifier);
|
||||||
|
|
||||||
this.reconnect_timer.Elapsed += delegate {
|
this.reconnect_timer.Elapsed += OnTimerElapsed;
|
||||||
if (!IsConnected && !IsConnecting)
|
|
||||||
Reconnect ();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.reconnect_timer.Start ();
|
this.reconnect_timer.Start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnTimerElapsed(object sender, EventArgs args)
|
||||||
|
{
|
||||||
|
if (!IsConnected && !IsConnecting)
|
||||||
|
Reconnect ();
|
||||||
|
}
|
||||||
|
|
||||||
public void Announce (SparkleAnnouncement announcement)
|
public void Announce (SparkleAnnouncement announcement)
|
||||||
{
|
{
|
||||||
|
@ -166,7 +167,11 @@ namespace SparkleLib {
|
||||||
{
|
{
|
||||||
if (this.reconnect_timer != null) {
|
if (this.reconnect_timer != null) {
|
||||||
this.reconnect_timer.Stop ();
|
this.reconnect_timer.Stop ();
|
||||||
|
|
||||||
|
this.reconnect_timer.Elapsed -= OnTimerElapsed;
|
||||||
this.reconnect_timer.Dispose ();
|
this.reconnect_timer.Dispose ();
|
||||||
|
|
||||||
|
this.reconnect_timer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -613,8 +613,12 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public void Dispose ()
|
public void Dispose ()
|
||||||
{
|
{
|
||||||
|
if (remote_timer != null) {
|
||||||
|
this.remote_timer.Elapsed -= RemoteTimerElapsedDelegate;
|
||||||
this.remote_timer.Stop ();
|
this.remote_timer.Stop ();
|
||||||
this.remote_timer.Dispose ();
|
this.remote_timer.Dispose ();
|
||||||
|
this.remote_timer = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.listener.Disconnected -= ListenerDisconnectedDelegate;
|
this.listener.Disconnected -= ListenerDisconnectedDelegate;
|
||||||
this.listener.AnnouncementReceived -= ListenerAnnouncementReceivedDelegate;
|
this.listener.AnnouncementReceived -= ListenerAnnouncementReceivedDelegate;
|
||||||
|
|
Loading…
Reference in a new issue