packet_peer_udp.h
1 #ifndef PACKET_PEER_UDP_H
2 #define PACKET_PEER_UDP_H
3 
4 
5 #include "io/packet_peer.h"
6 
7 class PacketPeerUDP : public PacketPeer {
8  OBJ_TYPE(PacketPeerUDP,PacketPeer);
9 
10 protected:
11 
12  static PacketPeerUDP* (*_create)();
13  static void _bind_methods();
14 
15  int _get_packet_address() const;
16  String _get_packet_ip() const;
17 
18  virtual Error _set_send_address(const String& p_address,int p_port);
19 
20 public:
21 
22  virtual Error listen(int p_port,int p_recv_buffer_size=65536)=0;
23  virtual void close()=0;
24  virtual Error wait()=0;
25  virtual bool is_listening() const=0;
26  virtual IP_Address get_packet_address() const=0;
27  virtual int get_packet_port() const=0;
28  virtual void set_send_address(const IP_Address& p_address,int p_port)=0;
29 
30 
31  static Ref<PacketPeerUDP> create_ref();
32  static PacketPeerUDP* create();
33 
34  PacketPeerUDP();
35 };
36 
37 #endif // PACKET_PEER_UDP_H
Definition: reference.h:78
Definition: packet_peer_udp.h:7
Definition: ip_address.h:34
Definition: packet_peer.h:35
Definition: ustring.h:64