lib/socket: move `blocking=` to `Socket`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 5 Jul 2015 17:52:13 +0000 (13:52 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 17 Jul 2015 12:15:35 +0000 (08:15 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/socket/socket.nit

index 7e9018f..d20bc0c 100644 (file)
@@ -29,6 +29,14 @@ abstract class Socket
        # Is this socket closed?
        var closed = false
 
+       # Set whether calls to `accept` are blocking
+       fun blocking=(value: Bool)
+       do
+               # We use the opposite from the native version as the native API
+               # is closer to the C API. In the Nity API, we use a positive version
+               # of the name.
+               native.non_blocking = not value
+       end
 end
 
 # A general TCP socket, either a `TCPStream` or a `TCPServer`
@@ -293,15 +301,6 @@ class TCPServer
                return new TCPStream.server_side(native)
        end
 
-       # Set whether calls to `accept` are blocking
-       fun blocking=(value: Bool)
-       do
-               # We use the opposite from the native version as the native API
-               # is closer to the C API. In the Nity API, we use a positive version
-               # of the name.
-               native.non_blocking = not value
-       end
-
        # Close this socket
        fun close
        do