Add some debug output

This commit is contained in:
Hylke Bons 2012-02-05 22:28:06 +01:00
parent 2097daee79
commit 19ba407129

View file

@ -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) {