COVISE Core
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
covise::Connection Class Reference

#include <covise_connect.h>

Inheritance diagram for covise::Connection:
Inheritance graph
[legend]
Collaboration diagram for covise::Connection:
Collaboration graph
[legend]

Public Member Functions

 Connection ()
 
 Connection (int sfd)
 
virtual ~Connection ()
 
SocketgetSocket () const
 
void set_peer (int id, int type)
 
int get_peer_id () const
 
int get_peer_type () const
 
int is_connected () const
 
virtual int receive (void *buf, unsigned nbyte) const
 
virtual int send (const void *buf, unsigned nbyte) const
 
virtual int recv_msg (Message *msg, char *ip=nullptr) const
 
virtual int recv_msg_fast (Message *msg) const
 
virtual bool sendMessage (const Message *msg) const override
 
virtual bool sendMessage (const UdpMessage *msg) const override
 
virtual int send_msg_fast (const Message *msg)
 
int check_for_input (float time=0.0) const
 
int get_port () const
 
void set_hostid (int id)
 
int get_hostid () const
 
int get_sendertype () const
 
int get_id (void(*remove_func)(int)) const
 
int get_sender_id () const
 
void close ()
 
void close_inform ()
 
int has_message () const
 
void print () const
 
Hostget_host ()
 
const Hostget_host () const
 
const char * get_hostname () const
 
- Public Member Functions inherited from covise::MessageSenderInterface
 MessageSenderInterface ()=default
 
virtual ~MessageSenderInterface ()=default
 
bool send (const covise::MessageBase *msg) const
 
bool send (const covise::Message *msg) const
 
bool send (const UdpMessage *msg) const
 
bool send (covise::TokenBuffer &tb, int type, Protocol p=Protocol::TCP) const
 

Public Attributes

char convert_to
 

Protected Member Functions

int get_id () const
 
bool sendMessage (int senderId, int senderType, const Message *msg) const
 
virtual bool sendMessage (const covise::Message *msg) const =0
 
virtual bool sendMessage (const UdpMessage *msg) const =0
 

Protected Attributes

class Socketsock = nullptr
 
int port
 
int sender_id
 
int send_type
 
int peer_id_
 
int peer_type_
 
int message_to_do
 
int bytes_to_process
 
unsigned long tru
 
char * read_buf = nullptr
 
Hostother_host = nullptr
 
int hostid
 
void(* remove_socket )(int)
 
int * header_int
 

Friends

class ServerConnection
 
class ConnectionList
 

Constructor & Destructor Documentation

◆ Connection() [1/2]

Connection::Connection ( )

◆ Connection() [2/2]

Connection::Connection ( int  sfd)

◆ ~Connection()

Connection::~Connection ( )
virtual

Member Function Documentation

◆ check_for_input()

int Connection::check_for_input ( float  time = 0.0) const

◆ close()

void Connection::close ( )

◆ close_inform()

void Connection::close_inform ( )

◆ get_host() [1/2]

Host * Connection::get_host ( )

◆ get_host() [2/2]

const Host * Connection::get_host ( ) const

◆ get_hostid()

int covise::Connection::get_hostid ( ) const
inline

◆ get_hostname()

const char * Connection::get_hostname ( ) const

◆ get_id() [1/2]

int Connection::get_id ( ) const
protected

◆ get_id() [2/2]

int Connection::get_id ( void(*)(int)  remove_func) const

◆ get_peer_id()

int Connection::get_peer_id ( ) const

◆ get_peer_type()

int Connection::get_peer_type ( ) const

◆ get_port()

int covise::Connection::get_port ( ) const
inline

◆ get_sender_id()

int covise::Connection::get_sender_id ( ) const
inline

◆ get_sendertype()

int covise::Connection::get_sendertype ( ) const
inline

◆ getSocket()

Socket * covise::Connection::getSocket ( ) const
inline

◆ has_message()

int covise::Connection::has_message ( ) const
inline

◆ is_connected()

int covise::Connection::is_connected ( ) const
inline

◆ print()

void covise::Connection::print ( ) const
inline

◆ receive()

int Connection::receive ( void buf,
unsigned  nbyte 
) const
virtual

◆ recv_msg()

int Connection::recv_msg ( Message msg,
char *  ip = nullptr 
) const
virtual

aw: this looks like stdin/stdout sending

◆ recv_msg_fast()

int Connection::recv_msg_fast ( Message msg) const
virtual

◆ send()

int Connection::send ( const void buf,
unsigned  nbyte 
) const
virtual

◆ send_msg_fast()

int Connection::send_msg_fast ( const Message msg)
virtual

◆ sendMessage() [1/3]

bool Connection::sendMessage ( const Message msg) const
overridevirtual

◆ sendMessage() [2/3]

bool Connection::sendMessage ( const UdpMessage msg) const
overridevirtual

◆ sendMessage() [3/3]

bool Connection::sendMessage ( int  senderId,
int  senderType,
const Message msg 
) const
protected

◆ set_hostid()

void Connection::set_hostid ( int  id)

◆ set_peer()

void Connection::set_peer ( int  id,
int  type 
)

Friends And Related Function Documentation

◆ ConnectionList

friend class ConnectionList
friend

◆ ServerConnection

friend class ServerConnection
friend

Member Data Documentation

◆ bytes_to_process

int covise::Connection::bytes_to_process
mutableprotected

◆ convert_to

char covise::Connection::convert_to

◆ header_int

int* covise::Connection::header_int
protected

◆ hostid

int covise::Connection::hostid
protected

◆ message_to_do

int covise::Connection::message_to_do
mutableprotected

◆ other_host

Host* covise::Connection::other_host = nullptr
protected

◆ peer_id_

int covise::Connection::peer_id_
protected

◆ peer_type_

int covise::Connection::peer_type_
protected

◆ port

int covise::Connection::port
protected

◆ read_buf

char* covise::Connection::read_buf = nullptr
protected

◆ remove_socket

void(* covise::Connection::remove_socket) (int)
mutableprotected

◆ send_type

int covise::Connection::send_type
protected

◆ sender_id

int covise::Connection::sender_id
protected

◆ sock

class Socket* covise::Connection::sock = nullptr
protected

◆ tru

unsigned long covise::Connection::tru
protected

The documentation for this class was generated from the following files: