Use inputstream as an alternative.
Server for converting data received through socket to input.
Note that this is only a server, for sending commands to it you also need a client.
Example client implementation available here.
To run:
./sensorhandler