parallelization_phase: use `ANode::validate` after AST shenanigans.
[nit.git] / lib / mpd.nit
index 97c38f2..727ac60 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Client for a MPD server
+# Music Player Daemon client library
 module mpd
 
 import socket
@@ -23,7 +23,7 @@ import socket
 class MPDConnection
 
        # Socket connection to server.
-       var socket: nullable Socket = null
+       var socket: nullable TCPStream = null
 
        # Server hostname.
        var host: String
@@ -40,9 +40,10 @@ class MPDConnection
        # Connect to the MPD server
        fun connect
        do
-               var p: nullable Socket = null
+               var p: nullable TCPStream = null
 
-               p = new Socket.client(host, port)
+               p = new TCPStream.connect(host, port)
+               assert p.connected
 
                sys.nanosleep(0,5000)