simple-socket library 1.2.0
TCPSocket.h
Go to the documentation of this file.
1#ifndef NET_TCPSocket_h__
2#define NET_TCPSocket_h__
3
4#include "SocketHandle.h"
5#include "InternetSocket.h"
6
7namespace NET
8{
11 {
12 public:
15
20 TCPSocket();
21
26 TCPSocket( Handle handle);
27
29
46 int sendAll( const void* buffer, size_t len);
47
49
65 void listen( int backlog = 5);
66
68
83 Handle accept() const;
84
86
106 Handle timedAccept( int timeout) const;
107 };
108
109} // namespace NET
110
111#endif // NET_TCPSocket_h__
static const int len
Definition CANFrame.h:7
InternetSocket(int sockfd)
create socket from a SocketHandle returned by an accept() call
A simple class to provide strict ownership of socket handles.
SocketHandle< TCPSocket > Handle
Handle for a new socket returned by accept.
Definition TCPSocket.h:14
int sendAll(const void *buffer, size_t len)
send data through a connected socket
Definition TCPSocket.cpp:18
void listen(int backlog=5)
listen for incoming connections
Definition TCPSocket.cpp:31
Handle timedAccept(int timeout) const
wait for another socket to connect
Definition TCPSocket.cpp:46
Handle accept() const
wait for another socket to connect
Definition TCPSocket.cpp:38