Sorry, I realized after the fact that this was in the wrong forum.
Anyhow, I've got it figured out....had to use sockets to do what I wanted (well, may have been possible with TcpClient, but I don't konw).
Anyhow, here's the code if anyone wants to re-use it
public string SendCmd(string cmd)
{
cmd = cmd + "\n";
StringBuilder outputBuilder = new StringBuilder("");
byte[] inputData = Encoding.ASCII.GetBytes(cmd);
s.Send(inputData);
s.Poll(250000,SelectMode.SelectRead);
while(s.Available > 0)
{
byte[] outputData = new byte[s.Available];
int received = s.Receive(outputData,0,outputData.Length,SocketFlags.None);
outputBuilder.Append(Encoding.ASCII.GetString(outputData,0,received));
s.Poll(100000,SelectMode.SelectRead);
}
return outputBuilder.ToString();
}
public bool InitializeConnection()
{
bool inited = false;
try
{
if(s != null)
{
s.Close();
}
s = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(textBox2.Text),3333);
s.Connect(remoteEP);
byte[] outputData = new byte[s.Available];
s.Receive(outputData);
inited = true;
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
return inited;
}
If anyone's interested in the app, just let me know and I'll post it here.
It has the following functions:
-> Play, Pause, Stop, Random, Previous, Next
-> Change playback mode
-> Load playlist, view by artist (slow for big playlists..on my ipaq anyways)
-> Search playlist (much faster, reccommended for large playlists)
It requires foo_controlserver which is really what does all the work. Very cool plugin.