Write a command to the MPD server

Property definitions

mpd $ MPDConnection :: write_and_check
	# Write a command to the MPD server
	protected fun write_and_check(msg: String)
	do
		if socket == null then connect

		socket.write(msg)
		sys.nanosleep(0,5000)
		var rep = socket.read(1024)
		if not rep.has_prefix("OK") then
			print "Error: MPD responded {rep}"
			socket.close
			socket = null
		end
	end
lib/mpd/mpd.nit:65,2--78,4