From 795910223f4c0e42fb08947d0ebac8f89c116f2f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 5 Feb 2012 22:28:06 +0100 Subject: [PATCH] Add some debug output --- SparkleLib/SparkleListenerTcp.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SparkleLib/SparkleListenerTcp.cs b/SparkleLib/SparkleListenerTcp.cs index cee4762a..90909e38 100755 --- a/SparkleLib/SparkleListenerTcp.cs +++ b/SparkleLib/SparkleListenerTcp.cs @@ -126,12 +126,20 @@ namespace SparkleLib { byte [] ping_bytes = Encoding.UTF8.GetBytes ("ping"); + Console.WriteLine ("1"); + this.socket.Send (ping_bytes); this.socket.ReceiveTimeout = 3 * 1000; + Console.WriteLine ("2"); + // 10057 means "Socket is not connected" - if (this.socket.Receive (bytes) < 1) + if (this.socket.Receive (bytes) < 1) { + Console.WriteLine ("3"); throw new SocketException (10057); + } + + Console.WriteLine ("4"); // The ping failed: disconnect completely } catch (SocketException) {