Update samples/General/TimeServer/time_client.ring - Use the Main() function
@@ -28,9 +28,10 @@ load "socket.ring"
sock = socket(AF_INET, SOCK_STREAM)
connect(sock, "127.0.0.1", 5051)
? "Enter 'time' to get the time or anything else to exit."
-main_loop(sock)
-func main_loop(sock)
+func main
+{
+ while True
{
switch getstring()
{
@@ -38,9 +39,10 @@ func main_loop(sock)
send(sock, "time")
the_time = recv(sock, 1024)
? "The time is " + the_time
- main_loop(sock)
else
send(sock, "bye!")
close(sock)
+ exit
+ }
}
}
