#include <sockets.h>
Inherited by SSLSocketIO.
Public Member Functions | |
| virtual | ~SocketIO () |
| virtual int | Recv (Socket *s, char *buf, size_t sz) |
| virtual int | Send (Socket *s, const char *buf, size_t sz) |
| int | Send (Socket *s, const Anope::string &buf) |
| virtual ClientSocket * | Accept (ListenSocket *s) |
| virtual SocketFlag | FinishAccept (ClientSocket *cs) |
| virtual void | Bind (Socket *s, const Anope::string &ip, int port=0) |
| virtual void | Connect (ConnectionSocket *s, const Anope::string &target, int port) |
| virtual SocketFlag | FinishConnect (ConnectionSocket *s) |
| virtual void | Destroy () |
Definition at line 131 of file sockets.h.
| ClientSocket * SocketIO::Accept | ( | ListenSocket * | s | ) | [virtual] |
Accept a connection from a socket
| s | The socket |
Reimplemented in SSLSocketIO.
Definition at line 340 of file sockets.cpp.
References accept, Socket::flags, Socket::GetFD(), Anope::LastError(), ClientSocket::OnAccept(), ListenSocket::OnAccept(), and sockaddrs::sa.
Referenced by ListenSocket::ProcessRead().
| void SocketIO::Bind | ( | Socket * | s, | |
| const Anope::string & | ip, | |||
| int | port = 0 | |||
| ) | [virtual] |
Bind a socket
| s | The socket | |
| ip | The IP to bind to | |
| port | The optional port to bind to |
Definition at line 363 of file sockets.cpp.
References Socket::bindaddr, Socket::GetFD(), Socket::IsIPv6(), Anope::LastError(), sockaddrs::pton(), sockaddrs::sa, and sockaddrs::size().
Referenced by Socket::Bind(), and ListenSocket::ListenSocket().
| void SocketIO::Connect | ( | ConnectionSocket * | s, | |
| const Anope::string & | target, | |||
| int | port | |||
| ) | [virtual] |
Connect the socket
| s | The socket | |
| target | IP to connect to | |
| port | to connect to |
Reimplemented in SSLSocketIO.
Definition at line 370 of file sockets.cpp.
References SocketEngine::Change(), ConnectionSocket::conaddr, Socket::flags, Socket::GetFD(), Socket::IsIPv6(), Anope::LastError(), Anope::LastErrorCode(), ConnectionSocket::OnConnect(), ConnectionSocket::OnError(), sockaddrs::pton(), sockaddrs::sa, SF_WRITABLE, and sockaddrs::size().
Referenced by ConnectionSocket::Connect().
| virtual void SocketIO::Destroy | ( | ) | [inline, virtual] |
Called when the socket is destructing
Reimplemented in SSLSocketIO.
Definition at line 186 of file sockets.h.
Referenced by Pipe::Pipe(), and Socket::~Socket().
| SocketFlag SocketIO::FinishAccept | ( | ClientSocket * | cs | ) | [virtual] |
Finished accepting a connection from a socket
| s | The socket |
Reimplemented in SSLSocketIO.
Definition at line 358 of file sockets.cpp.
Referenced by ClientSocket::Process().
| SocketFlag SocketIO::FinishConnect | ( | ConnectionSocket * | s | ) | [virtual] |
Called to potentially finish a pending connection
| s | The socket |
Reimplemented in SSLSocketIO.
Definition at line 392 of file sockets.cpp.
References Socket::flags, Socket::GetFD(), Anope::LastError(), ConnectionSocket::OnConnect(), ConnectionSocket::OnError(), SF_CONNECTED, and SF_CONNECTING.
Referenced by ConnectionSocket::Process().
| int SocketIO::Recv | ( | Socket * | s, | |
| char * | buf, | |||
| size_t | sz | |||
| ) | [virtual] |
Receive something from the buffer
| s | The socket | |
| buf | The buf to read to | |
| sz | How much to read |
Reimplemented in SSLSocketIO.
Definition at line 321 of file sockets.cpp.
References Socket::GetFD(), and TotalRead.
Referenced by BinarySocket::ProcessRead(), and BufferedSocket::ProcessRead().
| int SocketIO::Send | ( | Socket * | s, | |
| const Anope::string & | buf | |||
| ) |
Definition at line 335 of file sockets.cpp.
References Anope::string::c_str(), Anope::string::length(), and Send().
| int SocketIO::Send | ( | Socket * | s, | |
| const char * | buf, | |||
| size_t | sz | |||
| ) | [virtual] |
Write something to the socket
| s | The socket | |
| buf | The data to write | |
| size | The length of the data |
Reimplemented in SSLSocketIO.
Definition at line 328 of file sockets.cpp.
References Socket::GetFD(), and TotalWritten.
Referenced by BinarySocket::ProcessWrite(), BufferedSocket::ProcessWrite(), and Send().
1.7.1