Close Connection on a Socket, Context, Dialer, Listener, Stream, Pipe, or ncurl Session.
# S3 method for nanoContext
close(con, ...)# S3 method for nanoDialer
close(con, ...)
# S3 method for nanoListener
close(con, ...)
# S3 method for ncurlSession
close(con, ...)
# S3 method for nanoSocket
close(con, ...)
# S3 method for nanoPipe
close(con, ...)
# S3 method for nanoStream
close(con, ...)
Invisibly, an integer exit code (zero on success).
a Socket, Context, Dialer, Listener, Stream, Pipe, or ‘ncurlSession’.
not used.
Closing an object explicitly frees its resources. An object can also be removed directly in which case its resources are freed when the object is garbage collected.
Closing a Socket associated with a Context also closes the Context.
Dialers and Listeners are implicitly closed when the Socket they are associated with is closed.
Closing a Socket or a Context: messages that have been submitted for sending may be flushed or delivered, depending upon the transport. Closing the Socket while data is in transmission will likely lead to loss of that data. There is no automatic linger or flush to ensure that the Socket send buffers have completely transmitted.
Closing a Stream: if any send or receive operations are pending, they will be terminated and any new operations will fail after the connection is closed.
Closing an ‘ncurlSession’ closes the http(s) connection.
As Pipes are owned by the corresponding Socket, removing (and garbage collecting) a Pipe does not close it or free its resources. A Pipe may, however, be explicitly closed.
reap