Philipp Schreyer wrote in post #1139008:
> Create a client-server program

Make 2 scripts : one TCP server, one TCP client

> where the client connects to the
> server

A simple connect/close socket is done by a tcp ping :

http://www.java2s.com/Code/Ruby/Network/UsenetpingtoconnecttoaspecificportusingTCPorUDP.htm

Or a tcp client:

http://www.java2s.com/Code/Ruby/Network/OpenasockettohostandportReadlinesfromthesocket.htm

> and the server records in the database the ip and timestamp of
> the incoming connection

a Tcp server:
http://www.java2s.com/Code/Ruby/Network/BuildingaSimpleTCPServer.htm

Or use GServer :
http://www.java2s.com/Code/Ruby/Network/GServer.htm


> insert a record in database :

http://www.java2s.com/Code/Ruby/ActiveRecord/Addrecordtodatabasewithsavemethod.htm

-- 
Posted via http://www.ruby-forum.com/.