let send_to_server command =
  try
    let fd = Unix.openfile socket_file
      [Unix.O_WRONLY]
        0
    in
    let oc = Unix.out_channel_of_descr fd in
    output_string oc (command^"\n");
    flush oc;
    close_out oc
  with
    Unix.Unix_error (e,s1,s2) ->
      failwith (Printf.sprintf "%s %s: %s" (Unix.error_message e) s1 s2)