NeoMutt  2019-12-07-168-gc45f47
Teaching an old dog new tricks
DOXYGEN
Connection Struct Reference

An open network connection (socket) More...

#include "connection.h"

+ Collaboration diagram for Connection:

Data Fields

struct ConnAccount account
 
unsigned int ssf
 security strength factor, in bits More...
 
char inbuf [1024]
 
int bufpos
 
int fd
 
int available
 
void * sockdata
 
int(* conn_open )(struct Connection *conn)
 Open a socket Connection. More...
 
int(* conn_read )(struct Connection *conn, char *buf, size_t count)
 Read from a socket Connection. More...
 
int(* conn_write )(struct Connection *conn, const char *buf, size_t count)
 Write to a socket Connection. More...
 
int(* conn_poll )(struct Connection *conn, time_t wait_secs)
 Check whether a socket read would block. More...
 
int(* conn_close )(struct Connection *conn)
 Close a socket Connection. More...
 

Detailed Description

An open network connection (socket)

Definition at line 34 of file connection.h.

Field Documentation

◆ account

struct ConnAccount Connection::account

Definition at line 36 of file connection.h.

◆ ssf

unsigned int Connection::ssf

security strength factor, in bits

Definition at line 37 of file connection.h.

◆ inbuf

char Connection::inbuf[1024]

Definition at line 39 of file connection.h.

◆ bufpos

int Connection::bufpos

Definition at line 40 of file connection.h.

◆ fd

int Connection::fd

Definition at line 42 of file connection.h.

◆ available

int Connection::available

Definition at line 43 of file connection.h.

◆ sockdata

void* Connection::sockdata

Definition at line 45 of file connection.h.

◆ conn_open

int(* Connection::conn_open) (struct Connection *conn)

Open a socket Connection.

Parameters
connConnection to a server
Return values
0Success
-1Error

Definition at line 53 of file connection.h.

◆ conn_read

int(* Connection::conn_read) (struct Connection *conn, char *buf, size_t count)

Read from a socket Connection.

Parameters
connConnection to a server
bufBuffer to store the data
countNumber of bytes to read
Return values
>0Success, number of bytes read
-1Error, see errno

Definition at line 62 of file connection.h.

◆ conn_write

int(* Connection::conn_write) (struct Connection *conn, const char *buf, size_t count)

Write to a socket Connection.

Parameters
connConnection to a server
bufBuffer to read into
countNumber of bytes to read
Return values
>0Success, number of bytes written
-1Error, see errno

Definition at line 71 of file connection.h.

◆ conn_poll

int(* Connection::conn_poll) (struct Connection *conn, time_t wait_secs)

Check whether a socket read would block.

Parameters
connConnection to a server
wait_secsHow long to wait for a response
Return values
>0There is data to read
0Read would block
-1Connection doesn't support polling

Definition at line 80 of file connection.h.

◆ conn_close

int(* Connection::conn_close) (struct Connection *conn)

Close a socket Connection.

Parameters
connConnection to a server
Return values
0Success
-1Error, see errno

Definition at line 87 of file connection.h.


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