Help! I have no idea how to solve this! Server Client - IP - Timestamp

Hey Together!
Got a huge problem. I’m studying abroad in Denmark at the moment and i
have no clue of Ruby. In Germany I had a little Java, but not more then
system.out.println. Now I got a question which I have to solve. The
teacher doesn’t mind, that I have now knowledge about it and wants me to
not pass the semester, if i don’t solve it.

This is the question:

[quote]Create a client-server program where the client connects to the
server and the server records in the database the ip and timestamp of
the incoming connection
Test it with a server in a different ip from localhost (for example, The
teachers computer)
[/quote]

Could anyone help me? I have really no idea how to do. It could be in
pseudo code also!

Thank you in advance so much,
yours TotalNoob

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

http://www.tutorialspoint.com/ruby/ruby_database_access.htm

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs