X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=blobdiff_plain;f=qchess%2Fsrc%2Fnetwork.py;fp=qchess%2Fsrc%2Fnetwork.py;h=a50a97601fcfbce7cfce69714f661317ae2f734b;hp=b68503797eac486253d9440ec38d5116ae070471;hb=0a0868c019e4f68356a8793058d407539548759b;hpb=068745c990538769b9c4fd48f467a0f938e4c0d6 diff --git a/qchess/src/network.py b/qchess/src/network.py index b685037..a50a976 100644 --- a/qchess/src/network.py +++ b/qchess/src/network.py @@ -149,9 +149,11 @@ class Network(): if self.src in ready: s = self.src.recv(1) else: - raise Exception("UNRESPONSIVE") + raise Exception("NET_UNRESPONSIVE") + debug("Network get_response s = " + str(s)) + while s[len(s)-1] != '\n': # Timeout on each character in the message if network_timeout_delay > 0.0: @@ -161,7 +163,7 @@ class Network(): if self.src in ready: s += self.src.recv(1) else: - raise Exception("UNRESPONSIVE") + raise Exception("NET_UNRESPONSIVE") return s.strip(" \r\n") @@ -175,7 +177,7 @@ class Network(): if self.src in ready: self.src.send(s + "\n") else: - raise Exception("UNRESPONSIVE") + raise Exception("NET_UNRESPONSIVE")