F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TcpServerSocket.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title TcpServerSocket.hpp
3// \author mstarch
4// \brief hpp file for TcpServerSocket core implementation classes
5//
6// \copyright
7// Copyright 2009-2020, by the California Institute of Technology.
8// ALL RIGHTS RESERVED. United States Government Sponsorship
9// acknowledged.
10//
11// ======================================================================
12#ifndef DRV_TCPSERVER_TCPHELPER_HPP_
13#define DRV_TCPSERVER_TCPHELPER_HPP_
14
15#include <FpConfig.hpp>
16#include <Drv/Ip/IpSocket.hpp>
17#include <IpCfg.hpp>
18
19namespace Drv {
26class TcpServerSocket : public IpSocket {
27 public:
32
41 SocketIpStatus startup() override;
42
49 void shutdown() override;
50
51 PROTECTED:
64 I32 sendProtocol(const U8* const data, const U32 size) override;
71 I32 recvProtocol( U8* const data, const U32 size) override;
72 private:
73 NATIVE_INT_TYPE m_base_fd;
74};
75} // namespace Drv
76
77#endif /* DRV_TCPSERVER_TCPHELPER_HPP_ */
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
C++-compatible configuration header for fprime configuration.
Helper base-class for setting up Berkeley sockets.
Definition IpSocket.hpp:46
Helper for setting up Tcp using Berkeley sockets as a server.
TcpServerSocket()
Constructor for client socket tcp implementation.
I32 sendProtocol(const U8 *const data, const U32 size) override
Protocol specific implementation of send. Called directly with retry from send.
SocketIpStatus openProtocol(NATIVE_INT_TYPE &fd) override
Tcp specific implementation for opening a client socket connected to this server.
void shutdown() override
Shutdown and close the server socket followed by the open client.
I32 recvProtocol(U8 *const data, const U32 size) override
Protocol specific implementation of recv. Called directly with error handling from recv.
SocketIpStatus startup() override
Opens the server socket and listens, does not block.
SocketIpStatus
Status enumeration for socket return values.
Definition IpSocket.hpp:23