Ok,
I am working on a relay/reflector for a YawCam stream and ran into a little problem.
As best I can tell, the applet passes in
streamReq\r\n
And is returned
ok
( Or possibly "2many" )
Then it passes in a single byte to the server. Here is where I run into the problem
new byte b = 64;
Then it gets returned an int with the size, continues reading in bytes till the size is reached then draws image and loops back after a delay.
Am I correct so far?
It's the single byte that gets passed in that confuses me.
What exactly is it passing in?
PeteTheRed
Stream Server Question ( Technical )
This byte is just a way for the applet to tell the Yawcam application that it wants more image data. If Yawcam doesn't get this byte it will close the TCP connection after a while. 64 is just a number made up by me.
My thoughts were to make the system easy to expand, so this number should be possible to replace to request something different from the Yawcam application sometime when new functions are available.
Good Luck!
/Magnus Lundvall
My thoughts were to make the system easy to expand, so this number should be possible to replace to request something different from the Yawcam application sometime when new functions are available.
Good Luck!
/Magnus Lundvall
-
- Posts: 6
- Joined: Tue Oct 19, 2004 2:08 am
Ok,
I figured that part out. It was easy enough to tell the truth, I just wanted to make sure there was no significance to it other then a "I'm ready for an image" notification.
Now, the next step as far as I can tell is that it reads in an integer value via readInt.
Then an array of bytes is made and read into until the size is reached.
Now the problem I'm running into is that for the life of me, I can not get it to parse the Int. I'm crafting the relay in perl, and converting the formats is not working.
Any ideas? Is the image terminated in any way?
I figured that part out. It was easy enough to tell the truth, I just wanted to make sure there was no significance to it other then a "I'm ready for an image" notification.
Now, the next step as far as I can tell is that it reads in an integer value via readInt.
Am I Right so far? The Next 4 bytes passed back AFTER the [EDIT] "ok\r\n"; [/EDIT] are then parsed as an int to represent the filesize of the frame.readInt
public final int readInt()
throws IOExceptionSee the general contract of the readInt method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified by:
readInt in interface DataInput
Returns:
the next four bytes of this input stream, interpreted as an int.
Throws:
EOFException - if this input stream reaches the end before reading four bytes.
IOException - if an I/O error occurs.
See Also:
FilterInputStream.in
Then an array of bytes is made and read into until the size is reached.
Now the problem I'm running into is that for the life of me, I can not get it to parse the Int. I'm crafting the relay in perl, and converting the formats is not working.
Any ideas? Is the image terminated in any way?
-
- Posts: 6
- Joined: Tue Oct 19, 2004 2:08 am
-
- Posts: 6
- Joined: Tue Oct 19, 2004 2:08 am