mirror of
https://github.com/faye/websocket-driver-ruby.git
synced 2025-11-01 13:59:38 +00:00
19 lines
383 B
C
19 lines
383 B
C
#include <stdio.h>
|
|
#include "parser.h"
|
|
|
|
int main()
|
|
{
|
|
uint64_t chunk_size = 512;
|
|
uint8_t chunk[chunk_size];
|
|
uint64_t read = 0;
|
|
|
|
wsd_Parser *parser = wsd_Parser_create(NULL, 1);
|
|
|
|
do {
|
|
read = fread(chunk, sizeof(uint8_t), chunk_size, stdin);
|
|
wsd_Parser_parse(parser, read, chunk);
|
|
} while (read == chunk_size);
|
|
|
|
wsd_Parser_destroy(parser);
|
|
}
|