From 9775d9381766bc0258840c09cc64ef6c5f680037 Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 30 Jul 2016 16:19:24 +0900 Subject: [PATCH] [Modify] Polish it --- Example1/AudioStreamer.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Example1/AudioStreamer.cs b/Example1/AudioStreamer.cs index 11cbc2ae..8ad5b51c 100644 --- a/Example1/AudioStreamer.cs +++ b/Example1/AudioStreamer.cs @@ -193,6 +193,13 @@ namespace Example1 _websocket.Send (createTextMessage ("heartbeat", String.Empty)); } + public void Close () + { + Disconnect (); + _timer.Dispose (); + _notifier.Close (); + } + public void Connect (string username) { _name = username; @@ -215,9 +222,7 @@ namespace Example1 void IDisposable.Dispose () { - Disconnect (); - _timer.Dispose (); - _notifier.Close (); + Close (); } } }