Struct interface to NSC Stream (i.e., TCP) Sockets.
More...
#include "sim_interface.h"
|
virtual | ~INetStreamSocket () |
|
virtual int | accept (INetStreamSocket **handler)=0 |
| Accept an incoming connection. More...
|
|
virtual void | connect (const char *, int)=0 |
| Connect to a remote peer. More...
|
|
virtual void | disconnect ()=0 |
| Disconnect from a remote peer. More...
|
|
virtual bool | get_var (const char *var, char *result, int result_len) |
| Optional function used to get variables for this TCP connection. More...
|
|
virtual int | getpeername (struct sockaddr *sa, size_t *salen) |
| Get the peer name. More...
|
|
virtual int | getsockname (struct sockaddr *sa, size_t *salen) |
| Get the socket local name. More...
|
|
virtual bool | is_connected ()=0 |
| Check the connection state. More...
|
|
virtual bool | is_listening ()=0 |
| Check the listening state. More...
|
|
virtual void | listen (int)=0 |
| Put the socket in Listening state on a port. More...
|
|
virtual void | print_state (FILE *)=0 |
| Print the socket state. More...
|
|
virtual int | read_data (void *buf, int *buflen)=0 |
| Read some data. More...
|
|
virtual int | send_data (const void *data, int datalen)=0 |
| Send some data. More...
|
|
virtual bool | set_var (const char *var, const char *val) |
| Optional function used to set variables for this TCP connection. More...
|
|
virtual int | setsockopt (char *optname, void *val, size_t valsize)=0 |
| Set the socket options. More...
|
|
Struct interface to NSC Stream (i.e., TCP) Sockets.
Definition at line 259 of file sim_interface.h.
◆ ~INetStreamSocket()
virtual INetStreamSocket::~INetStreamSocket |
( |
| ) |
|
|
inlinevirtual |
◆ accept()
◆ connect()
virtual void INetStreamSocket::connect |
( |
const char * |
, |
|
|
int |
|
|
) |
| |
|
pure virtual |
◆ disconnect()
virtual void INetStreamSocket::disconnect |
( |
| ) |
|
|
pure virtual |
◆ get_var()
virtual bool INetStreamSocket::get_var |
( |
const char * |
var, |
|
|
char * |
result, |
|
|
int |
result_len |
|
) |
| |
|
inlinevirtual |
Optional function used to get variables for this TCP connection.
- Note
- not implemented
- Parameters
-
var | variable requested |
result | result result |
result_len | result length |
- Returns
- always false
Definition at line 356 of file sim_interface.h.
◆ getpeername()
virtual int INetStreamSocket::getpeername |
( |
struct sockaddr * |
sa, |
|
|
size_t * |
salen |
|
) |
| |
|
inlinevirtual |
◆ getsockname()
virtual int INetStreamSocket::getsockname |
( |
struct sockaddr * |
sa, |
|
|
size_t * |
salen |
|
) |
| |
|
inlinevirtual |
◆ is_connected()
virtual bool INetStreamSocket::is_connected |
( |
| ) |
|
|
pure virtual |
◆ is_listening()
virtual bool INetStreamSocket::is_listening |
( |
| ) |
|
|
pure virtual |
◆ listen()
virtual void INetStreamSocket::listen |
( |
int |
| ) |
|
|
pure virtual |
◆ print_state()
virtual void INetStreamSocket::print_state |
( |
FILE * |
| ) |
|
|
pure virtual |
◆ read_data()
virtual int INetStreamSocket::read_data |
( |
void * |
buf, |
|
|
int * |
buflen |
|
) |
| |
|
pure virtual |
◆ send_data()
virtual int INetStreamSocket::send_data |
( |
const void * |
data, |
|
|
int |
datalen |
|
) |
| |
|
pure virtual |
◆ set_var()
virtual bool INetStreamSocket::set_var |
( |
const char * |
var, |
|
|
const char * |
val |
|
) |
| |
|
inlinevirtual |
Optional function used to set variables for this TCP connection.
- Note
- not implemented
- Parameters
-
var | variable to set |
val | value to set |
- Returns
- always false
Definition at line 369 of file sim_interface.h.
◆ setsockopt()
virtual int INetStreamSocket::setsockopt |
( |
char * |
optname, |
|
|
void * |
val, |
|
|
size_t |
valsize |
|
) |
| |
|
pure virtual |
Set the socket options.
We need to pass the option name in as a string here. The reason for this is that different operating systems you compile on will have different numbers defined for the constants SO_SNDBUF and so on.
- Parameters
-
optname | name of the option |
val | option value |
valsize | size of the option value |
- Returns
The documentation for this struct was generated from the following file: