Home
Information
Classes
Download
Usage
Mail List
Requirements
Links
FAQ
Tutorial
include
UdpSocket.h
1
#ifndef STK_UDPSOCKET_H
2
#define STK_UDPSOCKET_H
3
4
#include "Socket.h"
5
6
namespace
stk {
7
8
/***************************************************/
29
/***************************************************/
30
31
class
UdpSocket
:
public
Socket
32
{
33
public
:
35
38
UdpSocket
(
int
port
= 2006 );
39
41
~UdpSocket
();
42
44
47
void
setDestination
(
int
port
= 2006, std::string hostname =
"localhost"
);
48
50
53
int
writeBuffer
(
const
void
*buffer,
long
bufferSize,
int
flags = 0);
54
56
int
readBuffer
(
void
*buffer,
long
bufferSize,
int
flags = 0);
57
59
int
writeBufferTo
(
const
void
*buffer,
long
bufferSize,
int
port
, std::string hostname =
"localhost"
,
int
flags = 0 );
60
61
protected
:
62
64
67
void
setAddress
(
struct
sockaddr_in *address,
int
port = 2006, std::string hostname =
"localhost"
);
68
69
struct
sockaddr_in address_;
70
bool
validAddress_;
71
72
};
73
74
}
// stk namespace
75
76
#endif
The Synthesis ToolKit in C++ (STK)
©1995--2021 Perry R. Cook and Gary P. Scavone. All Rights Reserved.