-
-
Notifications
You must be signed in to change notification settings - Fork 346
/
DatagramSocket.h
41 lines (29 loc) · 1.11 KB
/
DatagramSocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright 2011, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DATAGRAM_SOCKET_H
#define _DATAGRAM_SOCKET_H
#include <AbstractSocket.h>
class BDatagramSocket : public BAbstractSocket {
public:
BDatagramSocket();
BDatagramSocket(const BNetworkAddress& peer,
bigtime_t timeout = -1);
BDatagramSocket(const BDatagramSocket& other);
virtual ~BDatagramSocket();
virtual status_t Bind(const BNetworkAddress& peer);
virtual status_t Connect(const BNetworkAddress& peer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t SetBroadcast(bool broadcast);
void SetPeer(const BNetworkAddress& peer);
virtual size_t MaxTransmissionSize() const;
virtual ssize_t SendTo(const BNetworkAddress& address,
const void* buffer, size_t size);
virtual ssize_t ReceiveFrom(void* buffer, size_t bufferSize,
BNetworkAddress& from);
// BDataIO implementation
virtual ssize_t Read(void* buffer, size_t size);
virtual ssize_t Write(const void* buffer, size_t size);
};
#endif // _DATAGRAM_SOCKET_H