Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/network/udp_broadcast.h @ 9690

Last change on this file since 9690 was 9690, checked in by bensch, 18 years ago

some network-stuff

File size: 664 bytes
Line 
1/*!
2 * @file proto_class.h
3 * @brief Definition of ...
4 */
5
6#ifndef _UDP_BROADCAST_H
7#define _UDP_BROADCAST_H
8
9#include "netdefs.h"
10#include <cassert>
11
12#define BROADCAST_PACKET_SIZE 1024
13
14//! A class for sending/recieving brotcast packets for lan
15class UdpBroadcast
16{
17  NewObjectListDeclaration(UdpBroadcast);
18  public:
19    UdpBroadcast();
20    virtual ~UdpBroadcast();
21
22    bool listen( int port );
23    bool open( int port );
24    int send( byte * data, int length, IPaddress * ip = NULL );
25    int recv( byte * data, int maxLength, IPaddress * ip = NULL );
26
27  private:
28    int port;
29    UDPpacket * packet;
30    UDPsocket socket;
31
32};
33
34#endif /* _UDP_BROADCAST_H */
Note: See TracBrowser for help on using the repository browser.