|
Revision 3230, 1.1 kB
(checked in by robert, 9 years ago)
|
|
From Norman Vine (with small tweaks by Robert Osfield), build fixes for Cygwin
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #ifndef __BROADCASTER_H |
|---|
| 2 | #define __BROADCASTER_H |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | #if !defined(WIN32) || defined(__CYGWIN__) |
|---|
| 11 | #include <netinet/in.h> |
|---|
| 12 | #endif |
|---|
| 13 | |
|---|
| 14 | class Broadcaster |
|---|
| 15 | { |
|---|
| 16 | public : |
|---|
| 17 | |
|---|
| 18 | Broadcaster( void ); |
|---|
| 19 | ~Broadcaster( void ); |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | void setPort( const short port ); |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | void setBuffer( void *buffer, const unsigned int buffer_size ); |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | void setHost( const char *hostname ); |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | void sync( void ); |
|---|
| 34 | |
|---|
| 35 | private : |
|---|
| 36 | bool init( void ); |
|---|
| 37 | |
|---|
| 38 | private : |
|---|
| 39 | #if defined(WIN32) && !defined(__CYGWIN__) |
|---|
| 40 | SOCKET _so; |
|---|
| 41 | #else |
|---|
| 42 | int _so; |
|---|
| 43 | #endif |
|---|
| 44 | bool _initialized; |
|---|
| 45 | short _port; |
|---|
| 46 | void *_buffer; |
|---|
| 47 | unsigned int _buffer_size; |
|---|
| 48 | #if defined(WIN32) && !defined(__CYGWIN__) |
|---|
| 49 | SOCKADDR_IN saddr; |
|---|
| 50 | #else |
|---|
| 51 | struct sockaddr_in saddr; |
|---|
| 52 | #endif |
|---|
| 53 | unsigned long _address; |
|---|
| 54 | }; |
|---|
| 55 | #endif |
|---|