TUIO C++ Developer API
TUIO::TcpSender Class Reference

#include <TcpSender.h>

Inheritance diagram for TUIO::TcpSender:
TUIO::OscSender TUIO::WebSockSender

Public Member Functions

 TcpSender ()
 
 TcpSender (const char *host, int port)
 
 TcpSender (int port)
 
virtual ~TcpSender ()
 
bool sendOscPacket (osc::OutboundPacketStream *bundle)
 
bool isConnected ()
 
virtual void newClient (int tcp_client)
 
const char * tuio_type ()
 
- Public Member Functions inherited from TUIO::OscSender
 OscSender ()
 
virtual ~OscSender ()
 
bool isLocal ()
 
int getBufferSize ()
 

Public Attributes

int port_no
 
int tcp_socket
 
std::list< int > tcp_client_list
 
bool connected
 

Protected Attributes

char data_size [4]
 
char data_buffer [MAX_TCP_SIZE+4]
 
pthread_t server_thread
 
- Protected Attributes inherited from TUIO::OscSender
unsigned int buffer_size
 
bool local
 

Detailed Description

The TcpSender implements the TCP transport method for OSC

Author
Martin Kaltenbrunner
Version
2.0.a0

Constructor & Destructor Documentation

◆ TcpSender() [1/3]

TcpSender::TcpSender ( )

The default constructor creates a TcpSender that sends to the default TUIO port 3333 on localhost

◆ TcpSender() [2/3]

TcpSender::TcpSender ( const char *  host,
int  port 
)

This constructor creates a TcpSender that sends to the provided port on the the given host

Parameters
hostthe receiving host name
portthe outgoing TUIO TCP port number

◆ TcpSender() [3/3]

TcpSender::TcpSender ( int  port)

This constructor creates a TcpSender that listens to the provided port

Parameters
portthe incoming TUIO TCP port number

◆ ~TcpSender()

TcpSender::~TcpSender ( )
virtual

The destructor closes the socket.

Member Function Documentation

◆ isConnected()

bool TcpSender::isConnected ( )
virtual

This method returns the connection state

Returns
true if the connection is alive

Implements TUIO::OscSender.

◆ newClient()

void TcpSender::newClient ( int  tcp_client)
virtual

This method is called whenever a new client connects

Parameters
tcp_clientthe socket handle of the new client

Reimplemented in TUIO::WebSockSender.

◆ sendOscPacket()

bool TcpSender::sendOscPacket ( osc::OutboundPacketStream *  bundle)
virtual

This method delivers the provided OSC data

Parameters
*bundlethe OSC stream to deliver
Returns
true if the data was delivered successfully

Implements TUIO::OscSender.

Reimplemented in TUIO::WebSockSender.


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