F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
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 <Fw/Types/BasicTypes.hpp>
16 #include <Drv/Ip/IpSocket.hpp>
17 #include <IpCfg.hpp>
18 
19 namespace Drv {
26 class TcpServerSocket : public IpSocket {
27  public:
32 
41  SocketIpStatus startup(void);
42 
48  void shutdown(void);
49 
50  PROTECTED:
63  I32 sendProtocol(const U8* const data, const U32 size);
70  I32 recvProtocol( U8* const data, const U32 size);
71  private:
72  NATIVE_INT_TYPE m_base_fd;
73 };
74 } // namespace Drv
75 
76 #endif /* DRV_TCPSERVER_TCPHELPER_HPP_ */
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Drv::IpSocket
Helper base-class for setting up Berkley sockets.
Definition: IpSocket.hpp:45
Drv
Definition: BlockDriverImpl.cpp:5
IpCfg.hpp
Drv::TcpServerSocket::TcpServerSocket
TcpServerSocket()
Constructor for client socket tcp implementation.
Definition: TcpServerSocket.cpp:41
Drv::TcpServerSocket::sendProtocol
I32 sendProtocol(const U8 *const data, const U32 size)
Protocol specific implementation of send. Called directly with retry from send.
Definition: TcpServerSocket.cpp:104
Drv::TcpServerSocket::startup
SocketIpStatus startup(void)
Opens the server socket and listens, does not block.
Definition: TcpServerSocket.cpp:43
Drv::TcpServerSocket::shutdown
void shutdown(void)
Shutdown client socket, and listening server socket.
Definition: TcpServerSocket.cpp:81
Drv::TcpServerSocket::recvProtocol
I32 recvProtocol(U8 *const data, const U32 size)
Protocol specific implementation of recv. Called directly with error handling from recv.
Definition: TcpServerSocket.cpp:108
Drv::TcpServerSocket
Helper for setting up Tcp using Berkley sockets as a server.
Definition: TcpServerSocket.hpp:26
Drv::TcpServerSocket::openProtocol
SocketIpStatus openProtocol(NATIVE_INT_TYPE &fd)
Tcp specific implementation for opening a client socket connected to this server.
Definition: TcpServerSocket.cpp:88
Drv::SocketIpStatus
SocketIpStatus
Status enumeration for socket return values.
Definition: IpSocket.hpp:23
IpSocket.hpp
BasicTypes.hpp
Declares ISF basic types.
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29