You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to parse incoming TCP stream from AsyncSocket.
The natural way would be to pull data byte-by-byte according to parser definition, terminating the read when end of parser logic is reached.
but BitStream is defined as a Stream wrapper, with constructor from strings or file
typeBitStream*=refobject
stream: Stream
buffer: uint64
bitsLeft: int
This forces me to pull data from async socket into a string until I know I've read enough for the next parser.get pass.
Another workaround is pulling one byte at time and try parsing the collected buffer, if it succeeds restart for next packet, otherwise repeat.
It would be nice if the actual async pulling could be controlled by binarylang. Is there a way to make a Stream based BitStream work with an AsyncStream, or get the expected size of a parser given its arguments?
The text was updated successfully, but these errors were encountered:
I'm trying to parse incoming TCP stream from
AsyncSocket
.The natural way would be to pull data byte-by-byte according to parser definition, terminating the read when end of parser logic is reached.
but
BitStream
is defined as aStream
wrapper, with constructor from strings or fileThis forces me to pull data from async socket into a string until I know I've read enough for the next parser.get pass.
Another workaround is pulling one byte at time and try parsing the collected buffer, if it succeeds restart for next packet, otherwise repeat.
It would be nice if the actual async pulling could be controlled by binarylang. Is there a way to make a
Stream
basedBitStream
work with anAsyncStream
, or get the expected size of a parser given its arguments?The text was updated successfully, but these errors were encountered: