Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. require "socket"
  2.  
  3. # goes with tcp_server.cr
  4.  
  5. socket = TCPSocket.new "127.0.0.1", 9000
  6.  
  7. loop do
  8. socket << "message"
  9. sleep 0.01
  10. end
  11.  
  12.  
  13.  
  14. CMacbook-Pro-3:crystal ms$ crystal tcp_server.cr
  15. listen on 127.0.0.1:9000
  16. 127.0.0.1:53540 connected
  17. 90
  18. 88
  19. 90
  20. 87
  21. 89
  22. 88
  23. 89
  24. 88
  25. 88
  26. 88
  27. 89
  28. 88
  29. 89
  30. 89
  31. 89
  32. 88
  33. 89
  34. 90
  35. 87
  36. 89
  37. 88
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement