Forgive the response in english. I don't speak German, but I may be able to help.
MPD server listens on TCP port 6600
When you send commands, you must append CHR(13) to the end of the command.
Responses from MPD server will also be terminated with CHR(13)
I don't have MPD, so code below is untested.
Try something like this:
Sub Globals
Dim IP(0) As String
Dim bufferbits(0) As byte
End Sub
Sub ButtonConnect_Click
Dim IP(0) As String
IP() = Client.GetIP(textboxip.Text)
'client = network.dll client
client.Connect(IP(0),6600)
'stream = binaryfile object
stream.New1(client.GetStream,false)
label1.Text = "Connection established."
timer1.Enabled = true
'//issue the "next" command
stream.WriteBytes (stream.StringToBytes("next" & CHR(13)) )
End Sub
Sub Timer1_Tick
If client.DataAvailable = true Then
Dim bufferbits(4096) As byte
count = stream.ReadBytes(bufferbits(),4096)
buffer = bit.BytesToString(bufferbits(),0,count)
'show server response
label1.Text = buffer
End Sub
Best wishes,
__________________
Brian Rathbone
Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2
Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
|