summaryrefslogtreecommitdiff
path: root/docs/man/man3/ircd_connector.3
diff options
context:
space:
mode:
Diffstat (limited to 'docs/man/man3/ircd_connector.3')
-rw-r--r--docs/man/man3/ircd_connector.3120
1 files changed, 103 insertions, 17 deletions
diff --git a/docs/man/man3/ircd_connector.3 b/docs/man/man3/ircd_connector.3
index 226b6797e..aae366a68 100644
--- a/docs/man/man3/ircd_connector.3
+++ b/docs/man/man3/ircd_connector.3
@@ -1,4 +1,4 @@
-.TH "ircd_connector" 3 "15 May 2005" "InspIRCd" \" -*- nroff -*-
+.TH "ircd_connector" 3 "24 May 2005" "InspIRCd" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -16,6 +16,10 @@ Inherits \fBExtensible\fP.
.in +1c
.ti -1c
+.RI "\fBircd_connector\fP ()"
+.br
+.RI "\fIConstructor clears the sendq and initialises the fd to -1. \fP"
+.ti -1c
.RI "bool \fBMakeOutboundConnection\fP (char *newhost, int newport)"
.br
.RI "\fICreate an outbound connection to a listening socket. \fP"
@@ -72,9 +76,9 @@ Inherits \fBExtensible\fP.
.br
.RI "\fIClose the connection by calling close() on its file descriptor This function call updates no other data. \fP"
.ti -1c
-.RI "void \fBAddBuffer\fP (std::string a)"
+.RI "bool \fBAddBuffer\fP (std::string a)"
.br
-.RI "\fIThis method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. \fP"
+.RI "\fIThis method adds text to the ircd connection's buffer This buffer's maximum size is one megabyte, the method returning false if the buffer is full. \fP"
.ti -1c
.RI "bool \fBBufferIsComplete\fP ()"
.br
@@ -95,6 +99,34 @@ Inherits \fBExtensible\fP.
.RI "std::string \fBGetVersionString\fP ()"
.br
.RI "\fIThis method returns the version string of the remote server. \fP"
+.ti -1c
+.RI "bool \fBAddWriteBuf\fP (std::string data)"
+.br
+.RI "\fIAdds data to the connection's sendQ to be flushed later Fails if there is an error pending on the connection. \fP"
+.ti -1c
+.RI "bool \fBFlushWriteBuf\fP ()"
+.br
+.RI "\fIFlushes as much of the data from the buffer as possible, and advances the queue pointer to what is left. \fP"
+.ti -1c
+.RI "void \fBSetWriteError\fP (std::string error)"
+.br
+.RI "\fISets the error string for this connection. \fP"
+.ti -1c
+.RI "std::string \fBGetWriteError\fP ()"
+.br
+.RI "\fIGets the error string for this connection. \fP"
+.ti -1c
+.RI "bool \fBHasBufferedOutput\fP ()"
+.br
+.RI "\fIReturns true if there is data to be written that hasn't been sent yet. \fP"
+.ti -1c
+.RI "bool \fBCheckPing\fP ()"
+.br
+.RI "\fIChecks if the connection replied to its last ping, and if it did sends another and returns true, if not, returns false. \fP"
+.ti -1c
+.RI "void \fBResetPing\fP ()"
+.br
+.RI "\fIResets the ping counter. \fP"
.in -1c
.SS "Public Attributes"
@@ -153,6 +185,22 @@ Inherits \fBExtensible\fP.
.RI "std::string \fBversion\fP"
.br
.RI "\fIThis string holds the ircd's version response. \fP"
+.ti -1c
+.RI "std::string \fBsendq\fP"
+.br
+.RI "\fISendQ of the outbound connector, does not have a limit. \fP"
+.ti -1c
+.RI "std::string \fBWriteError\fP"
+.br
+.RI "\fIWrite error of connection. \fP"
+.ti -1c
+.RI "time_t \fBnextping\fP"
+.br
+.RI "\fITime this connection was last pinged. \fP"
+.ti -1c
+.RI "bool \fBreplied\fP"
+.br
+.RI "\fIDid this connection reply to its last ping? \fP"
.in -1c
.SH "Detailed Description"
.PP
@@ -161,20 +209,34 @@ Each connection has one or more of these each represents ONE outbound connection
A listening socket that accepts server type connections is represented by one class serverrec. Class serverrec will instantiate several objects of type ircd_connector to represent each established connection, inbound or outbound. So, to determine all linked servers you must walk through all the serverrecs that the core defines, and in each one iterate through until you find connection(s) relating to the server you want information on. The core and module API provide functions for this.
.PP
Definition at line 56 of file connection.h.
+.SH "Constructor & Destructor Documentation"
+.PP
+.SS "ircd_connector::ircd_connector ()"
+.PP
+Constructor clears the sendq and initialises the fd to -1.
.SH "Member Function Documentation"
.PP
-.SS "void ircd_connector::AddBuffer (std::string a)"
+.SS "bool ircd_connector::AddBuffer (std::string a)"
.PP
-This method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. It is the sending server's responsibility to ensure sent data is kept within reasonable quanities.
+This method adds text to the ircd connection's buffer This buffer's maximum size is one megabyte, the method returning false if the buffer is full.
+.SS "bool ircd_connector::AddWriteBuf (std::string data)"
+.PP
+Adds data to the connection's sendQ to be flushed later Fails if there is an error pending on the connection. Referenced by serverrec::SendPacket().
.SS "bool ircd_connector::BufferIsComplete ()"
.PP
This method returns true if the buffer contains at least one carriage return character, e.g. one line can be read from the buffer successfully.
+.SS "bool ircd_connector::CheckPing ()"
+.PP
+Checks if the connection replied to its last ping, and if it did sends another and returns true, if not, returns false.
.SS "void ircd_connector::ClearBuffer ()"
.PP
This method clears the server's buffer by setting it to an empty string.
.SS "void ircd_connector::CloseConnection ()"
.PP
-Close the connection by calling close() on its file descriptor This function call updates no other data.
+Close the connection by calling close() on its file descriptor This function call updates no other data. Referenced by serverrec::SendPacket().
+.SS "bool ircd_connector::FlushWriteBuf ()"
+.PP
+Flushes as much of the data from the buffer as possible, and advances the queue pointer to what is left. Referenced by serverrec::SendPacket().
.SS "std::string ircd_connector::GetBuffer ()"
.PP
This method retrieves the first string from the tail end of the buffer and advances the tail end of the buffer past the returned string, in a similar manner to strtok().
@@ -189,43 +251,55 @@ Get the file descriptor associated with this connection.
Get the ip address (not servername) associated with this connection.
.SS "std::string ircd_connector::GetServerName ()"
.PP
-Return the servername on this established connection.
+Return the servername on this established connection. Referenced by serverrec::SendPacket().
.SS "int ircd_connector::GetServerPort ()"
.PP
Get the port number being used for this connection If the connection is outbound this will be the remote port otherwise it will be the local port, so it can always be gautanteed as open at the address given in \fBGetServerIP()\fP.
.SS "int ircd_connector::GetState ()"
.PP
-Get the state flags for this connection.
+Get the state flags for this connection. Referenced by serverrec::SendPacket().
.SS "std::string ircd_connector::GetVersionString ()"
.PP
This method returns the version string of the remote server. If the server has no version string an empty string is returned.
+.SS "std::string ircd_connector::GetWriteError ()"
+.PP
+Gets the error string for this connection. Referenced by serverrec::SendPacket().
+.SS "bool ircd_connector::HasBufferedOutput ()"
+.PP
+Returns true if there is data to be written that hasn't been sent yet.
.SS "bool ircd_connector::MakeOutboundConnection (char * newhost, int newport)"
.PP
-Create an outbound connection to a listening socket.
+Create an outbound connection to a listening socket. Referenced by serverrec::BeginLink(), and serverrec::MeshCookie().
+.SS "void ircd_connector::ResetPing ()"
+.PP
+Resets the ping counter.
.SS "void ircd_connector::SetDescription (std::string desc)"
.PP
Set the server description of this connection.
.SS "void ircd_connector::SetDescriptor (int fd)"
.PP
-Set the file descriptor for this connection.
+Set the file descriptor for this connection. Referenced by serverrec::AddIncoming().
.SS "bool ircd_connector::SetHostAddress (char * host, int port)\fC [private]\fP"
.PP
PRIVATE function to set the host address and port to connect to.
.SS "bool ircd_connector::SetHostAndPort (char * newhost, int newport)"
.PP
-Set both the host and the port in one operation for this connection.
+Set both the host and the port in one operation for this connection. Referenced by serverrec::AddIncoming(), serverrec::BeginLink(), and serverrec::MeshCookie().
.SS "void ircd_connector::SetServerName (std::string serv)"
.PP
-Set the server name of this connection.
+Set the server name of this connection. Referenced by serverrec::AddIncoming(), serverrec::BeginLink(), and serverrec::MeshCookie().
.SS "void ircd_connector::SetServerPort (int p)"
.PP
Set the port used by this connection.
.SS "void ircd_connector::SetState (int state)"
.PP
-Set the state flags for this connection.
+Set the state flags for this connection. Referenced by serverrec::AddIncoming(), serverrec::BeginLink(), serverrec::MeshCookie(), and serverrec::SendPacket().
.SS "void ircd_connector::SetVersionString (std::string newversion)"
.PP
This method sets the version string of the remote server.
+.SS "void ircd_connector::SetWriteError (std::string error)"
+.PP
+Sets the error string for this connection.
.SH "Member Data Documentation"
.PP
.SS "sockaddr_in \fBircd_connector::addr\fP\fC [private]\fP"
@@ -239,18 +313,27 @@ Sockaddr of the outbound ip and port. Definition at line 61 of file connection.h
File descriptor of the connection. Definition at line 65 of file connection.h.
.SS "char \fBircd_connector::host\fP[MAXBUF]"
.PP
-When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 101 of file connection.h.
+When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 117 of file connection.h.
.SS "std::string \fBircd_connector::ircdbuffer\fP"
.PP
IRCD Buffer for input characters, holds as many lines as are pending - Note that the final line may not be complete and should only be read when there is a
.br
- seperator. Definition at line 94 of file connection.h.
+ seperator. Definition at line 110 of file connection.h.
+.SS "time_t \fBircd_connector::nextping\fP\fC [private]\fP"
+.PP
+Time this connection was last pinged. Definition at line 98 of file connection.h.
.SS "int \fBircd_connector::port\fP"
.PP
-When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 107 of file connection.h.
+When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 123 of file connection.h.
+.SS "bool \fBircd_connector::replied\fP\fC [private]\fP"
+.PP
+Did this connection reply to its last ping? Definition at line 102 of file connection.h.
.SS "std::vector<std::string> \fBircd_connector::routes\fP"
.PP
-\fBServer\fP names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B. Definition at line 113 of file connection.h.
+\fBServer\fP names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B. Definition at line 129 of file connection.h.
+.SS "std::string \fBircd_connector::sendq\fP\fC [private]\fP"
+.PP
+SendQ of the outbound connector, does not have a limit. Definition at line 90 of file connection.h.
.SS "std::string \fBircd_connector::servername\fP\fC [private]\fP"
.PP
\fBServer\fP name. Definition at line 69 of file connection.h.
@@ -260,6 +343,9 @@ State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTE
.SS "std::string \fBircd_connector::version\fP\fC [private]\fP"
.PP
This string holds the ircd's version response. Definition at line 86 of file connection.h.
+.SS "std::string \fBircd_connector::WriteError\fP\fC [private]\fP"
+.PP
+Write error of connection. Definition at line 94 of file connection.h.
.SH "Author"
.PP