source: de.wigbels.ruby/hothotread/bla.rb@ 9125727

Last change on this file since 9125727 was 7b22594, checked in by njw <njw@…>, 11 years ago

hothotread added

  • Property mode set to 100644
File size: 325 bytes
RevLine 
[7b22594]1require 'socket'
2
3s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
4sockaddr = Socket.sockaddr_in(2701, '192.168.14.42')
5begin
6s.connect(sockaddr)
7rescue
8 puts "error: #{$!}"
9else
10 s.print "version\r\n"
11 data = s.recvfrom(1024)
12 puts data
13 # and terminate the connection when we're done
14 s.close
15end
16
Note: See TracBrowser for help on using the repository browser.