Read.h File Reference
#include "base/AsyncCall.h"
#include "comm/forward.h"
#include "CommCalls.h"
#include "sbuf/forward.h"
Include dependency graph for Read.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.


void Comm::Read (const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback)
bool Comm::MonitorsRead (int fd)
 whether the FD socket is being monitored for
Comm::Flag Comm::ReadNow (CommIoCbParams &params, SBuf &buf)
void Comm::ReadCancel (int fd, AsyncCall::Pointer &callback)
 Cancel the read pending on FD. No action if none pending. More...
time_t Comm::MortalReadTimeout (const time_t startTime, const time_t lifetimeLimit)
 maximum read delay for readers with limited lifetime More...
void comm_read_base (const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback)
void comm_read (const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback)
void comm_read_cancel (int fd, IOCB *callback, void *data)


PF Comm::HandleRead
 callback handler to process an FD which is available for reading More...

Function Documentation

◆ comm_read()

◆ comm_read_base()

void comm_read_base ( const Comm::ConnectionPointer conn,
char *  buf,
int  size,
AsyncCall::Pointer callback 

Queue a read. If a buffer is given the callback is scheduled when the read completes, on error, or on file descriptor close.

If no buffer (NULL) is given the callback is scheduled when the socket FD is ready for a read(2)/recv(2).

Definition at line 56 of file

References assert, COMM_SELECT_READ, COMMIO_FD_READCB, commStopHalfClosedMonitor(), conn, debugs, Comm::Connection::fd, fd_table, Comm::HandleRead, Comm::IOCB_READ, Comm::IsConnOpen(), NULL, and Comm::SetSelect().

Referenced by comm_read(), and Comm::Read().

◆ comm_read_cancel()

void comm_read_cancel ( int  fd,
IOCB callback,
void *  data 

Cancel a pending read. Assert that we have the right parameters, and that there are no pending read events!

XXX: We do not assert that there are no pending read events and with async calls it becomes even more difficult. The whole interface should be reworked to do callback->cancel() instead of searching for places where the callback may be stored and updating the state of those places.

AHC Don't call the comm handlers?

Definition at line 179 of file

References Comm::IoCallback::active(), assert, Comm::IoCallback::callback, Comm::IoCallback::cancel(), COMM_SELECT_READ, COMMIO_FD_READCB, debugs, RefCount< C >::getRaw(), isOpen(), NULL, and Comm::SetSelect().

Referenced by IdleConnList::clearHandlers(), and comm_read().






Web Site Translations