2 * Copyright 2011-2016, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
9 #include <AbstractSocket.h>
12 class BSocket
: public BAbstractSocket
{
15 BSocket(const BNetworkAddress
& peer
,
16 bigtime_t timeout
= B_INFINITE_TIMEOUT
);
17 BSocket(const BSocket
& other
);
20 virtual status_t
Bind(const BNetworkAddress
& peer
,
21 bool reuseAddr
= true);
23 virtual status_t
Accept(BAbstractSocket
*& _socket
);
25 virtual status_t
Connect(const BNetworkAddress
& peer
,
26 bigtime_t timeout
= B_INFINITE_TIMEOUT
);
28 // BDataIO implementation
30 virtual ssize_t
Read(void* buffer
, size_t size
);
31 virtual ssize_t
Write(const void* buffer
, size_t size
);
35 void _SetTo(int fd
, const BNetworkAddress
& local
,
36 const BNetworkAddress
& peer
);