Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


TcpServer.h
1#ifndef STK_TCPSERVER_H
2#define STK_TCPSERVER_H
3
4#include "Socket.h"
5
6namespace stk {
7
8/***************************************************/
31/***************************************************/
32
33class TcpServer : public Socket
34{
35 public:
37
40 TcpServer( int port = 2006 );
41
44
46
51 int accept( void );
52
54 int writeBuffer(const void *buffer, long bufferSize, int flags = 0);
55
57 int readBuffer(void *buffer, long bufferSize, int flags = 0);
58
59 protected:
60
61};
62
63} // stk namespace
64
65#endif
STK internet socket abstract base class.
Definition Socket.h:39
int port(void) const
Return the socket port number.
Definition Socket.h:60
STK TCP socket server class.
Definition TcpServer.h:34
~TcpServer()
The class destructor closes the socket instance, breaking any existing connections.
TcpServer(int port=2006)
Default constructor creates a local socket server on port 2006 (or the specified port number).
int accept(void)
Extract the first pending connection request from the queue and create a new connection,...
int writeBuffer(const void *buffer, long bufferSize, int flags=0)
Write a buffer over the socket connection. Returns the number of bytes written or -1 if an error occu...
int readBuffer(void *buffer, long bufferSize, int flags=0)
Read a buffer from the socket connection, up to length bufferSize. Returns the number of bytes read o...
The STK namespace.
Definition ADSR.h:6

The Synthesis ToolKit in C++ (STK)
©1995--2023 Perry R. Cook and Gary P. Scavone. All Rights Reserved.