OSDN Git Service

Added a comment for gets_safe()
authordaigo <beatles@users.sourceforge.jp>
Sun, 25 Apr 2010 04:25:24 +0000 (13:25 +0900)
committerDaigo Moriwaki <daigo at debian dot org>
Sun, 25 Apr 2010 04:25:24 +0000 (13:25 +0900)
shogi-server

index 1058135..7f6d068 100755 (executable)
@@ -41,6 +41,12 @@ require 'tempfile'
 
 ShogiServer.reload
 
 
 ShogiServer.reload
 
+# Return
+#   - a received string
+#   - :timeout
+#   - :exception
+#   - nil when a socket is closed
+#
 def gets_safe(socket, timeout=nil)
   if r = select([socket], nil, nil, timeout)
     return r[0].first.gets
 def gets_safe(socket, timeout=nil)
   if r = select([socket], nil, nil, timeout)
     return r[0].first.gets