MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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)
| ~NfsConnection ()
| Must be run from EventLoop's thread. More...
gcc_pure const char * | GetServer () const
gcc_pure const char * | GetExportName () const
EventLoop & | GetEventLoop ()
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

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

Definition at line 137 of file Connection.hxx.

NfsConnection::~NfsConnection | ( |  | ) |

Must be run from EventLoop's thread.

## Member Function Documentation

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.

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

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

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

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

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

Definition at line 159 of file Connection.hxx.

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

Definition at line 155 of file Connection.hxx.

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

Definition at line 150 of file Connection.hxx.

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

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

Throws std::runtime_error on error.

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

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

Throws std::runtime_error on error.

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

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

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

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

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

- lib/nfs/Connection.hxx