vertx / io.vertx.reactivex.core.net / NetSocket / sendFile

sendFile

open fun sendFile(filename: String): NetSocket

Tell the operating system to stream a file as specified by filename directly from disk to the outgoing connection, bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.

Parameters

filename - file name of the file to send

Return
a reference to this, so the API can be used fluently

open fun sendFile(filename: String, offset: Long): NetSocket

Tell the operating system to stream a file as specified by filename directly from disk to the outgoing connection, bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.

Parameters

filename - file name of the file to send

offset - offset

Return
a reference to this, so the API can be used fluently

open fun sendFile(filename: String, offset: Long, length: Long): NetSocket

Tell the operating system to stream a file as specified by filename directly from disk to the outgoing connection, bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.

Parameters

filename - file name of the file to send

offset - offset

length - length

Return
a reference to this, so the API can be used fluently

open fun sendFile(filename: String, resultHandler: Handler<AsyncResult<Void>>): NetSocket

Same as io.vertx.reactivex.core.net.NetSocket#sendFile but also takes a handler that will be called when the send has completed or a failure has occurred

Parameters

filename - file name of the file to send

resultHandler - handler

Return
a reference to this, so the API can be used fluently

open fun sendFile(filename: String, offset: Long, resultHandler: Handler<AsyncResult<Void>>): NetSocket

Same as io.vertx.reactivex.core.net.NetSocket#sendFile but also takes a handler that will be called when the send has completed or a failure has occurred

Parameters

filename - file name of the file to send

offset - offset

resultHandler - handler

Return
a reference to this, so the API can be used fluently

open fun sendFile(filename: String, offset: Long, length: Long, resultHandler: Handler<AsyncResult<Void>>): NetSocket

Same as io.vertx.reactivex.core.net.NetSocket#sendFile but also takes a handler that will be called when the send has completed or a failure has occurred

Parameters

filename - file name of the file to send

offset - offset

length - length

resultHandler - handler

Return
a reference to this, so the API can be used fluently