8 #include "Arp/System/Commons/Net/IpAddress.hpp" 9 #include "Arp/System/Commons/Net/SocketType.hpp" 10 #include "Arp/System/Commons/Net/PollMode.hpp" 11 #include "Arp/System/Commons/Net/SelectMode.hpp" 12 #include "Arp/System/Commons/Net/ShutdownMode.hpp" 13 #include "Arp/System/Commons/Net/SocketError.hpp" 14 #include "Arp/System/Commons/Net/SocketDomain.hpp" 15 #include "Arp/System/Commons/Net/SocketOptionName.hpp" 18 namespace Arp {
namespace System {
namespace Ve
23 namespace Arp {
namespace System {
namespace Commons {
namespace Net
122 typedef std::shared_ptr<Socket>
Ptr;
166 bool IsBlocking(
void)
const;
171 bool IsConnected(
void)
const;
178 IpAddress GetRemoteIpAddress(
void)
const;
185 int GetRemotePort(
void)
const;
288 int Send(
const void *pBuffer,
size_t length,
SocketError& error);
299 int SendTo(
const void *pBuffer,
size_t length,
IpAddress ip4Adress,
int port,
SocketError& error);
308 int Receive(
void *pBuffer,
size_t length,
SocketError& error);
319 int ReceiveFrom(
void *pBuffer,
size_t length,
IpAddress& ip4Adress,
int& port,
SocketError& error);
388 SocketError GetOptionReuseAddress(
bool& enabled)
const;
409 SocketError GetOptionKeepAlive(
bool& enabled)
const;
428 SocketError GetOptionBroadcast(
bool& enabled)
const;
470 SocketError SetOptionLinger(
bool enable,
size_t timeout);
478 SocketError GetOptionLinger(
bool& enable,
size_t& timeout);
484 using ISocketService = Arp::System::Ve::ISocketService;
488 Socket(ISocketService *pSocket);
495 ISocketService *pSocketService;
521 inline bool Socket::IsBlocking(
void)
const 528 return remoteIpAddress;
531 inline int Socket::GetRemotePort(
void)
const 536 inline bool Socket::IsConnected(
void)
const 538 return this->isConnected;
SocketType
Enumeration of supported socket types.
Definition: SocketType.hpp:13
SocketError
Possible error codes for socket operation results.
Definition: SocketError.hpp:14
std::chrono::milliseconds Milliseconds
The Arp Milliseconds unit class.
Definition: TypeSystem.h:36
SocketOptionName
Specifies socket options to be set by the application. Copied from Eclr Socket Adaption ...
Definition: SocketOptionName.hpp:16
Interface to realizes ethernet based communications.
Definition: Socket.hpp:117
Socket is in blocking mode, i.e. the Send*, Receive* and Accept methods will block if no data is avai...
std::chrono::microseconds Microseconds
The Arp Microseconds unit class.
Definition: TypeSystem.h:34
std::shared_ptr< Socket > Ptr
Contextual definition of pointer type.
Definition: Socket.hpp:122
SocketDomain
Supported communication domains, selecting the protocol for communication.
Definition: SocketDomain.hpp:13
PollMode
This enum is used to specifiy the poll mode of the <cref name="Socket::Poll"> operation.
Definition: PollMode.hpp:14
Root namespace for the PLCnext API
SocketBlockingMode
Supported blocking modes.
Definition: Socket.hpp:27
ShutdownMode
This enum is used to specifiy the shutdown mode of the <cref name="Socket::Shutdown(ShutdownMode)"> o...
Definition: ShutdownMode.hpp:14
SelectMode
Modes for Select call to check different data channels.
Definition: SelectMode.hpp:13
Connect operation should be polled.
Unified representation for ip address schemes.
Definition: IpAddress.hpp:13
System components used by the System, Device, Plc or Io domains.
Accept operation should be polled.
Socket is in non-blocking mode, i.e. the Send*, Receive* and Accept methods will not block if no data...
Interface to realize TLS Connection over TCP
Definition: TlsSocket.hpp:31