I have spend hours to convert an old net v2 project and to port it to WinRT in C#. Its a RTSP client thats sending commands to a DVBservice (DVBViewer). So, at this moment, the WinForm Program has been renewed and its working prety fine. Connecting, sending and receiving commands to the server and finaly the stream to my localhost UDP port are fully working and the ts stream is fully readable via VLC and RTP protocol.
But now, i'd like to write my Metro app with this stuff. I managed to do the work and seems to be almost finish (at least the Socket and stream stuff).
But now, I'm getting stuck on a stupid problem. I CAN'T communicate with the RTSP Server. My Stream Reader/Writer is'nt working and I've tried a lot.
The app is based on code from the Uniriotec.DV project, so for any futher info, you can find it by google.
So, here's the point I'm getting stuck: Its the main handle, thats getting the StreamSocket with the Stream (the messages) together.
//Set input and output stream filters in the main client app
RTSPBufferedReader = new BufferedReader<Stream> (RTSPsocket);
RTSPBufferedWriter = new BufferedWriter<Stream> (RTSPsocket);
namespace RTSP.Client
{
public class BufferedReader<T> : StreamReader where T : Stream
{
private StreamSocket socket;
private T unbufferedStream;
private StreamSocket streamSocket;
public T UnbufferedStream
{
get { return unbufferedStream; }
set { unbufferedStream = value; }
}
public BufferedReader(T myStream)
: base(myStream)
{
unbufferedStream = myStream;
}
public BufferedReader(StreamSocket mySocket)
: base(new Stream(mySocket)) // <== here is the problem, saying "could'nt establish an instance of the abstract or interface class "System.IO.Stream"....
{
this.streamSocket = mySocket;
}
}
}
Do you have an idea where I did the error?
Thanks for answering, Jo
PS: I need await writer.StoreAsync(); because the answer is send approx 10-15 sec. later, when the server is ready to thread the request and sends me SessionID and so back.