MPD: NfsConnection Class Reference

MPD 0.20.15

Data Structures | Public Member Functions | Protected Member Functions
NfsConnection Class Referenceabstract

An asynchronous connection to a NFS server. More...

`#include <Connection.hxx>`

Inheritance diagram for NfsConnection:
[legend]
Collaboration diagram for NfsConnection:
[legend]

## Public Member Functions
gcc_nonnull_all | NfsConnection (EventLoop &_loop, const char *_server, const char *_export_name) noexcept
| ~NfsConnection ()
| Must be run from EventLoop's thread. More...
gcc_pure const char * | GetServer () const noexcept
gcc_pure const char * | GetExportName () const noexcept
EventLoop & | GetEventLoop () noexcept
void | AddLease (NfsLease &lease)
| Ensure that the connection is established. More...
void | RemoveLease (NfsLease &lease)
void | Stat (const char *path, NfsCallback &callback)
void | OpenDirectory (const char *path, NfsCallback &callback)
const struct nfsdirent * | ReadDirectory (struct nfsdir *dir)
void | CloseDirectory (struct nfsdir *dir)
void | Open (const char *path, int flags, NfsCallback &callback)
| Throws std::runtime_error on error. More...
void | Stat (struct nfsfh *fh, NfsCallback &callback)
void | Read (struct nfsfh *fh, uint64_t offset, size_t size, NfsCallback &callback)
| Throws std::runtime_error on error. More...
void | Cancel (NfsCallback &callback)
void | Close (struct nfsfh *fh)
void | CancelAndClose (struct nfsfh *fh, NfsCallback &callback)

## Protected Member Functions
virtual void | OnNfsConnectionError (std::exception_ptr &&e)=0

## Detailed Description

An asynchronous connection to a NFS server.

Definition at line 42 of file Connection.hxx.

## Constructor & Destructor Documentation

## ◆ NfsConnection()

gcc_nonnull_all NfsConnection::NfsConnection | ( | EventLoop & | _loop,
|  | const char * | _server,
|  | const char * | _export_name
| ) |  |
| inlinenoexcept

Definition at line 137 of file Connection.hxx.

## ◆ ~NfsConnection()

NfsConnection::~NfsConnection | ( |  | ) |

Must be run from EventLoop's thread.

## Member Function Documentation

## ◆ AddLease()

void NfsConnection::AddLease | ( | NfsLease & | lease | ) |

Ensure that the connection is established.

The connection is kept up while at least one NfsLease is registered.

This method is thread-safe. However, NfsLease's methods will be invoked from within the EventLoop's thread.

## ◆ Cancel()

void NfsConnection::Cancel | ( | NfsCallback & | callback | ) |

## ◆ CancelAndClose()

void NfsConnection::CancelAndClose | ( | struct nfsfh * | fh,
|  | NfsCallback & | callback
| ) |  |

## ◆ Close()

void NfsConnection::Close | ( | struct nfsfh * | fh | ) |

## ◆ CloseDirectory()

void NfsConnection::CloseDirectory | ( | struct nfsdir * | dir | ) |

## ◆ GetEventLoop()

EventLoop& NfsConnection::GetEventLoop | ( |  | ) |
| inlinenoexcept

Definition at line 159 of file Connection.hxx.

## ◆ GetExportName()

gcc_pure const char* NfsConnection::GetExportName | ( |  | ) | const
| inlinenoexcept

Definition at line 155 of file Connection.hxx.

## ◆ GetServer()

gcc_pure const char* NfsConnection::GetServer | ( |  | ) | const
| inlinenoexcept

Definition at line 150 of file Connection.hxx.

## ◆ OnNfsConnectionError()

virtual void NfsConnection::OnNfsConnectionError | ( | std::exception_ptr && | e | ) |
| protectedpure virtual

## ◆ Open()

void NfsConnection::Open | ( | const char * | path,
|  | int | flags,
|  | NfsCallback & | callback
| ) |  |

Throws std::runtime_error on error.

## ◆ OpenDirectory()

void NfsConnection::OpenDirectory | ( | const char * | path,
|  | NfsCallback & | callback
| ) |  |

## ◆ Read()

void NfsConnection::Read | ( | struct nfsfh * | fh,
|  | uint64_t | offset,
|  | size_t | size,
|  | NfsCallback & | callback
| ) |  |

Throws std::runtime_error on error.

## ◆ ReadDirectory()

const struct nfsdirent* NfsConnection::ReadDirectory | ( | struct nfsdir * | dir | ) |

## ◆ RemoveLease()

void NfsConnection::RemoveLease | ( | NfsLease & | lease | ) |

## ◆ Stat() [1/2]

void NfsConnection::Stat | ( | const char * | path,
|  | NfsCallback & | callback
| ) |  |

## ◆ Stat() [2/2]

void NfsConnection::Stat | ( | struct nfsfh * | fh,
|  | NfsCallback & | callback
| ) |  |

The documentation for this class was generated from the following file:

- lib/nfs/Connection.hxx