Last change
on this file since 05d3bab was c22952c, checked in by Norbert Wigbels <njw@…>, 9 years ago |
Stromzaehler
|
-
Property mode
set to
100644
|
File size:
325 bytes
|
Line | |
---|
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.