Ruby Socket example


SUBMITTED BY: Guest

DATE: May 21, 2015, 2:02 p.m.

FORMAT: Ruby

SIZE: 278 Bytes

HITS: 814

  1. puts'========================================='
  2. require 'socket'
  3. puts'== daytime server =='
  4. # Open a socket to a local daytime server, read, and print.
  5. print TCPSocket.open('129.6.15.28', 'daytime').read
  6. puts'========================================='

comments powered by Disqus