From b6bf45c019df09d756ec4daa4e4d612e6e2bd9b2 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 30 Nov 2015 12:06:31 +0900 Subject: [PATCH] [Modify] Polish it --- Example2/Chat.cs | 8 ++++---- Example3/Chat.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Example2/Chat.cs b/Example2/Chat.cs index 68387a7a..a6b367d9 100644 --- a/Example2/Chat.cs +++ b/Example2/Chat.cs @@ -32,9 +32,9 @@ namespace Example2 return Interlocked.Increment (ref _number); } - protected override void OnOpen () + protected override void OnClose (CloseEventArgs e) { - _name = getName (); + Sessions.Broadcast (String.Format ("{0} got logged off...", _name)); } protected override void OnMessage (MessageEventArgs e) @@ -42,9 +42,9 @@ namespace Example2 Sessions.Broadcast (String.Format ("{0}: {1}", _name, e.Data)); } - protected override void OnClose (CloseEventArgs e) + protected override void OnOpen () { - Sessions.Broadcast (String.Format ("{0} got logged off...", _name)); + _name = getName (); } } } diff --git a/Example3/Chat.cs b/Example3/Chat.cs index 172f0f8d..b1a3f4d7 100644 --- a/Example3/Chat.cs +++ b/Example3/Chat.cs @@ -32,9 +32,9 @@ namespace Example3 return Interlocked.Increment (ref _number); } - protected override void OnOpen () + protected override void OnClose (CloseEventArgs e) { - _name = getName (); + Sessions.Broadcast (String.Format ("{0} got logged off...", _name)); } protected override void OnMessage (MessageEventArgs e) @@ -42,9 +42,9 @@ namespace Example3 Sessions.Broadcast (String.Format ("{0}: {1}", _name, e.Data)); } - protected override void OnClose (CloseEventArgs e) + protected override void OnOpen () { - Sessions.Broadcast (String.Format ("{0} got logged off...", _name)); + _name = getName (); } } }