YARP
Yet Another Robot Platform
TcpAcceptor.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-FileCopyrightText: 2010 Anne van Rossum <anne@almende.com>
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
7
#ifndef YARP_OS_IMPL_POSIX_TCPACCEPTOR_H
8
#define YARP_OS_IMPL_POSIX_TCPACCEPTOR_H
9
10
11
#include <
yarp/os/TwoWayStream.h
>
12
13
#include <
yarp/os/impl/posix/TcpStream.h
>
14
15
// General files
16
17
namespace
yarp
{
18
namespace
os {
19
namespace
impl {
20
namespace
posix {
21
22
23
/* **************************************************************************************
24
* Interface of TcpAcceptor
25
* **************************************************************************************/
26
27
class
YARP_os_impl_API
TcpAcceptor
28
{
29
public
:
30
TcpAcceptor
() =
default
;
31
32
virtual
~TcpAcceptor
() =
default
;
33
34
int
open(
const
yarp::os::Contact
& address);
35
36
int
connect
(
const
yarp::os::Contact
& address);
37
38
int
close();
39
40
int
accept(
TcpStream
&new_stream);
41
42
int
get_port_number
()
43
{
44
return
port_number;
45
}
46
47
protected
:
48
int
shared_open(
const
yarp::os::Contact
& address);
49
50
int
get_handle
()
51
{
52
return
ad;
53
}
54
55
void
set_handle
(
int
h)
56
{
57
ad = h;
58
}
59
60
private
:
61
// acceptor descriptor
62
int
ad {-1};
63
int
port_number {-1};
64
};
65
66
}
// namespace posix
67
}
// namespace impl
68
}
// namespace os
69
}
// namespace yarp
70
71
72
#endif
// YARP_OS_IMPL_POSIX_TCPACCEPTOR_H
TwoWayStream.h
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition:
Contact.h:36
yarp::os::impl::posix::TcpAcceptor
Definition:
TcpAcceptor.h:28
yarp::os::impl::posix::TcpAcceptor::TcpAcceptor
TcpAcceptor()=default
yarp::os::impl::posix::TcpAcceptor::get_handle
int get_handle()
Definition:
TcpAcceptor.h:50
yarp::os::impl::posix::TcpAcceptor::~TcpAcceptor
virtual ~TcpAcceptor()=default
yarp::os::impl::posix::TcpAcceptor::set_handle
void set_handle(int h)
Definition:
TcpAcceptor.h:55
yarp::os::impl::posix::TcpAcceptor::get_port_number
int get_port_number()
Definition:
TcpAcceptor.h:42
yarp::os::impl::posix::TcpAcceptor::connect
int connect(const yarp::os::Contact &address)
yarp::os::impl::posix::TcpStream
Definition:
TcpStream.h:31
yarp
The main, catch-all namespace for YARP.
Definition:
dirs.h:16
TcpStream.h
YARP_os_impl_API
#define YARP_os_impl_API
Definition:
api.h:46
YARP
3.5.1
src
libYARP_os
src
yarp
os
impl
posix
TcpAcceptor.h
Generated on Sat Dec 25 2021 02:23:04 for YARP by
1.9.1