libnfs-python icon indicating copy to clipboard operation
libnfs-python copied to clipboard

weither close nfs connetion

Open gssjl2008 opened this issue 4 years ago • 1 comments

I use it to check whether NFS is writable, I do not see NFS close the connection

      nfs = libnfs.NFS("nfs://{server}{path}".format(server=nfs_server, path=nfs_path))
      f = nfs.open("/test_nfs_rw.file", "w")
      f.write(str(time.time()))
      f.close()

Have you closed the connection?

gssjl2008 avatar Aug 05 '21 03:08 gssjl2008

On Thu, Aug 5, 2021 at 1:28 PM gssjl2008 @.***> wrote:

I use it to check whether NFS is writable, I do not see NFS close the connection

You mean in wireshark? You do not see a CLOSE in wireshark?

NFS is a stateless protocol. There is no close() function in NFS. So when the application calls f.close() this is basically a no-op when it comes to the NFS protocol.

  nfs = libnfs.NFS("nfs://{server}{path}".format(server=nfs_server, path=nfs_path))

  f = nfs.open("/test_nfs_rw.file", "w")

  f.write(str(time.time()))

  f.close()

Have you closed the connection?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

sahlberg avatar Aug 05 '21 04:08 sahlberg