Last change
on this file since 4fd0ab9 was 7b22594, checked in by njw <njw@…>, 11 years ago |
hothotread added
|
-
Property mode
set to
100644
|
File size:
325 bytes
|
Rev | Line | |
---|
[7b22594] | 1 | require 'socket'
|
---|
| 2 |
|
---|
| 3 | s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
|
---|
| 4 | sockaddr = Socket.sockaddr_in(2701, '192.168.14.42')
|
---|
| 5 | begin
|
---|
| 6 | s.connect(sockaddr)
|
---|
| 7 | rescue
|
---|
| 8 | puts "error: #{$!}"
|
---|
| 9 | else
|
---|
| 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
|
---|
| 15 | end
|
---|
| 16 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.