I’ve been working with the Thrift.jl package to create bindings for MapD. I am able to successfully connect to the database for many methods, but I am noticing that if I don’t submit a call for a few minutes, then I lose the connection to the database. Re-running my connection code then running the method again runs instantly.
function connect(host::String, port::Int, user::String, passwd::String, dbname::String) socket = TSocket(host, port) Thrift.set_field!(socket, :io, Base.connect(host, port)) #transport = TBufferedTransport(socket) # https://github.com/tanmaykm/Thrift.jl/issues/12 proto = TBinaryProtocol(socket) c = MapD.MapDClient(proto) session = MapD.connect(c, user, passwd, dbname) return MapDConnection(session, c) end
My question is, when using
Base.connect to create a socket, is there a way to keep the socket alive for a specified amount of time? In libuv, there is uv_tcp_keepalive, but that doesn’t seem present for the Julia sockets.