|
EvEmu
0.8.4
11 September 2021
|
Simple wrapper for sockets. More...
#include "Socket.h"
Public Member Functions | |
| Socket (int af, int type, int protocol) | |
| ~Socket () | |
| int | connect (const sockaddr *name, unsigned int namelen) |
| unsigned int | recv (void *buf, unsigned int len, int flags) |
| unsigned int | recvfrom (void *buf, unsigned int len, int flags, sockaddr *from, unsigned int *fromlen) |
| unsigned int | send (const void *buf, unsigned int len, int flags) |
| unsigned int | sendto (const void *buf, unsigned int len, int flags, const sockaddr *to, unsigned int tolen) |
| int | bind (const sockaddr *name, unsigned int namelen) |
| int | listen (int backlog=SOMAXCONN) |
| Socket * | accept (sockaddr *addr, unsigned int *addrlen) |
| int | setopt (int level, int optname, const void *optval, unsigned int optlen) |
| int | fcntl (int cmd, long arg) |
Protected Member Functions | |
| Socket (SOCKET sock) | |
Protected Attributes | |
| SOCKET | mSock |
| Socket::Socket | ( | int | af, |
| int | type, | ||
| int | protocol | ||
| ) |
Definition at line 30 of file Socket.cpp.
References INVALID_SOCKET, and mSock.
Referenced by accept().

| Socket::~Socket | ( | ) |
|
protected |
| Socket * Socket::accept | ( | sockaddr * | addr, |
| unsigned int * | addrlen | ||
| ) |
Definition at line 89 of file Socket.cpp.
References INVALID_SOCKET, mSock, and Socket().
Referenced by BaseTCPServer::ListenNewConnections().


| int Socket::bind | ( | const sockaddr * | name, |
| unsigned int | namelen | ||
| ) |
Definition at line 79 of file Socket.cpp.
References mSock.
Referenced by BaseTCPServer::Open().

| int Socket::connect | ( | const sockaddr * | name, |
| unsigned int | namelen | ||
| ) |
Definition at line 54 of file Socket.cpp.
References mSock.
Referenced by TCPConnection::Connect().

| int Socket::fcntl | ( | int | cmd, |
| long | arg | ||
| ) |
Definition at line 104 of file Socket.cpp.
References mSock.
Referenced by TCPConnection::Connect(), BaseTCPServer::ListenNewConnections(), and BaseTCPServer::Open().

| int Socket::listen | ( | int | backlog = SOMAXCONN | ) |
Definition at line 84 of file Socket.cpp.
References mSock.
Referenced by BaseTCPServer::Open().

| unsigned int Socket::recv | ( | void * | buf, |
| unsigned int | len, | ||
| int | flags | ||
| ) |
Definition at line 59 of file Socket.cpp.
References mSock.
Referenced by TCPConnection::RecvData().

| unsigned int Socket::recvfrom | ( | void * | buf, |
| unsigned int | len, | ||
| int | flags, | ||
| sockaddr * | from, | ||
| unsigned int * | fromlen | ||
| ) |
| unsigned int Socket::send | ( | const void * | buf, |
| unsigned int | len, | ||
| int | flags | ||
| ) |
Definition at line 69 of file Socket.cpp.
References mSock.
Referenced by TCPConnection::SendData().

| unsigned int Socket::sendto | ( | const void * | buf, |
| unsigned int | len, | ||
| int | flags, | ||
| const sockaddr * | to, | ||
| unsigned int | tolen | ||
| ) |
| int Socket::setopt | ( | int | level, |
| int | optname, | ||
| const void * | optval, | ||
| unsigned int | optlen | ||
| ) |
Definition at line 99 of file Socket.cpp.
References mSock.
Referenced by TCPConnection::Connect(), BaseTCPServer::ListenNewConnections(), and BaseTCPServer::Open().

|
protected |