Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear buffers on allocation #6

Open
znewman01 opened this issue Dec 8, 2014 · 0 comments
Open

Clear buffers on allocation #6

znewman01 opened this issue Dec 8, 2014 · 0 comments

Comments

@znewman01
Copy link
Collaborator

And handle differently-sized buffers better.

> make tcp
ocamlbuild -Is src examples/tcp_echo_server.native -lflags -cclib,-luv -tag debug -cflag -g
Finished, 0 targets (0 cached) in 00:00:00.
Finished, 50 targets (50 cached) in 00:00:00.
> ./_build/examples/tcp_echo_server.native 
(^_^) Server listening on localhost:7889
      Try `echo -n 'hello' | nc localhost 7889`

In another window:

> echo -n 'hello' | nc localhost 7889
hello�Gت�0�se /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
> echo -n 'hello' | nc localhost 7889
hello 

Output of the TCP server:

Received and wrote back 'hello'
Received and wrote back 'hello'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant