Changed the socket connection.

The socket now upon connection sends the last record found in the database. And further sends data on every update found from the datalogger.