Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <vsnet_socketbase.h>
Public Member Functions | |
VsnetSocket (int sock, const AddressIP &remote_ip, const char *socktype, SocketSet &set) | |
virtual | ~VsnetSocket () |
virtual bool | isTcp () const =0 |
virtual int | optPayloadSize () const =0 |
virtual int | queueLen (int pri)=0 |
bool | eq (const VsnetSocket &r) const |
bool | lt (const VsnetSocket &r) const |
bool | sameAddress (const VsnetSocket &r) const |
virtual int | sendbuf (Packet *packet, const AddressIP *to, int pcktflags)=0 |
virtual int | recvbuf (Packet *p, AddressIP *from)=0 |
virtual void | dump (std::ostream &ostr) const =0 |
const AddressIP & | getRemoteAddress () const |
virtual bool | setRemoteAddress (const AddressIP &) |
const AddressIP & | getLocalAddress () const |
bool | setLocalAddress (const AddressIP &lip) |
![]() | |
VsnetSocketBase (int fd, const char *socktype, SocketSet &set) | |
virtual | ~VsnetSocketBase () |
bool | valid () const |
int | get_fd () const |
int | close_fd () |
const char * | get_socktype () const |
bool | set_block () |
bool | set_nonblock () |
bool | get_nonblock () const |
virtual bool | isActive ()=0 |
void | disconnect (const char *s) |
virtual bool | lower_selected (int datalen=-1)=0 |
virtual bool | need_test_writable () |
virtual bool | write_on_negative () |
virtual int | get_write_fd () const |
virtual int | lower_sendbuf () |
virtual void | lower_clean_sendbuf () |
virtual bool | isReadyToSend (fd_set *) |
void | setSet (SocketSet *set) |
Protected Attributes | |
AddressIP | _remote_ip |
AddressIP | _local_ip |
![]() | |
int | _fd |
SocketSet * | _set |
Friends | |
std::ostream & | operator<< (std::ostream &ostr, const VsnetSocket &s) |
Additional Inherited Members | |
![]() | |
virtual void | child_disconnect (const char *s) |
Definition at line 107 of file vsnet_socketbase.h.
VsnetSocket::VsnetSocket | ( | int | sock, |
const AddressIP & | remote_ip, | ||
const char * | socktype, | ||
SocketSet & | set | ||
) |
Definition at line 16 of file vsnet_socketbase.cpp.
References VsnetSocket().
Referenced by VsnetSocket().
|
virtual |
Definition at line 21 of file vsnet_socketbase.cpp.
|
pure virtual |
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
Referenced by operator<<().
bool VsnetSocket::eq | ( | const VsnetSocket & | r) | const |
Definition at line 31 of file vsnet_socketbase.cpp.
References _remote_ip, VsnetSocketBase::get_fd(), and isTcp().
|
inline |
Definition at line 144 of file vsnet_socketbase.h.
References _local_ip.
|
inline |
Definition at line 134 of file vsnet_socketbase.h.
References _remote_ip.
|
pure virtual |
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
Referenced by eq(), lt(), and sameAddress().
bool VsnetSocket::lt | ( | const VsnetSocket & | r) | const |
Definition at line 36 of file vsnet_socketbase.cpp.
References _remote_ip, VsnetSocketBase::get_fd(), and isTcp().
|
pure virtual |
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
This function copies or moves data into the given PacketMem variable. It is preferred over the other recvbuf function because it may reduce the number of copy operations by at least one.
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
bool VsnetSocket::sameAddress | ( | const VsnetSocket & | r) | const |
|
pure virtual |
Implemented in VsnetTCPSocket, and VsnetUDPSocket.
Definition at line 148 of file vsnet_socketbase.h.
References _local_ip.
Reimplemented in VsnetUDPSocket.
Definition at line 138 of file vsnet_socketbase.h.
|
friend |
|
protected |
Definition at line 157 of file vsnet_socketbase.h.
Referenced by getLocalAddress(), and setLocalAddress().
|
protected |
Definition at line 156 of file vsnet_socketbase.h.
Referenced by VsnetUDPSocket::dump(), VsnetTCPSocket::dump(), eq(), getRemoteAddress(), lt(), VsnetTCPSocket::recvbuf(), sameAddress(), VsnetUDPSocket::sendbuf(), and VsnetUDPSocket::setRemoteAddress().