PLCnext API Documentation  22.9.0.33
Classes | Enumerations | Functions
Arp::System::Commons::Net Namespace Reference

Namespace for network specific classes, enumerations and functions. More...

Classes

class  IpAddress
 Unified representation for ip address schemes. More...
 
class  Socket
 Interface to realizes ethernet based communications. More...
 
class  TlsSocket
 Interface to realize TLS Connection over TCP More...
 

Enumerations

enum class  PollMode {
  None = 0 , Read = 1 , Write = 2 , Connect = 3 ,
  Accept = 4
}
 This enum is used to specifiy the poll mode of the <cref name="Socket::Poll" > operation. More...
 
enum class  SelectMode { Read = 0 , Write = 1 , Connect = 3 , Accept = 4 }
 Modes for Select call to check different data channels. More...
 
enum class  ShutdownMode { None = 0 , Read = 1 , Write = 2 , ReadWrite = 3 }
 This enum is used to specifiy the shutdown mode of the <cref name="Socket::Shutdown(ShutdownMode)" > operation. More...
 
enum class  SocketBlockingMode { None = 0 , Blocking = 1 , NoneBlocking = 2 }
 Supported blocking modes. More...
 
enum class  SocketType { None = 0 , Tcp = 1 , Udp = 2 }
 Enumeration of supported socket types. More...
 
enum class  SocketDomain { None = 0 , Ipv4 = 1 , Ipv6 = 2 }
 Supported communication domains, selecting the protocol for communication. More...
 
enum class  SocketError {
  None = 0 , Any = -1 , Interrupted = (10000 + 4) , InvalidArgument = (10000 + 22) ,
  TooManyOpenSockets = (10000 + 24) , WouldBlock = (10000 + 35) , InProgress = (10000 + 36) , AlreadyInProgress = (10000 + 37) ,
  NotSocket = (10000 + 38) , DestinationAddressRequired = (10000 + 39) , MessageSize = (10000 + 40) , ProtoType = (10000 + 41) ,
  ProtocolOption = (10000 + 42) , ProtocolNotSupported = (10000 + 43) , SocketNotSupported = (10000 + 44) , OperationNotSupported = (10000 + 45) ,
  ProtocolFamilyNotSupported = (10000 + 46) , AddressFamilyNotSupported = (10000 + 47) , AddressAlreadyInUse = (10000 + 48) , AddressNotAvailable = (10000 + 49) ,
  NetworkDown = (10000 + 50) , NetworkUnreachable = (10000 + 51) , NetworkReset = (10000 + 52) , ConnectionAborted = (10000 + 53) ,
  ConnectionReset = (10000 + 54) , NoBufferSpaceAvailable = (10000 + 55) , IsConnected = (10000 + 56) , NotConnected = (10000 + 57) ,
  Shutdown = (10000 + 58) , TimedOut = (10000 + 60) , ConnectionRefused = (10000 + 61) , HostDown = (10000 + 64) ,
  HostUnreachable = (10000 + 65) , ProcessLimit = (10000 + 67) , SystemNotReady = (10000 + 91) , VersionNotSupported = (10000 + 92) ,
  NotInitialized = (10000 + 93) , Disconnecting = (10000 + 101) , HostNotFound = (10000 + 1001) , TryAgain = (10000 + 1002)
}
 Possible error codes for socket operation results. More...
 
enum class  SocketOptionName {
  SocketOptionReuseAddress = 0x0004 , SocketOptionKeepAlive = 0x0008 , SocketOptionBroadcast = 0x0020 , SocketOptionReceiveTimeout = 0x0200 ,
  SocketOptionSendTimeout = 0x0800 , SocketOptionNoDelay = 1
}
 Specifies socket options to be set by the application. Copied from Eclr Socket Adaption More...
 

Functions

std::ostream & operator<< (std::ostream &os, const IpAddress &ipAddress)
 The ostream operator is used for logging and string formatting. More...
 
std::istream & operator>> (std::istream &is, IpAddress &ipAddress)
 The istream operator is used for string parsing. More...
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, PollMode value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, PollMode &value)
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, ShutdownMode value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, ShutdownMode &value)
 
ARP_CXX_SYMBOL_EXPORT std::ostream & operator<< (std::ostream &os, SocketError value)
 
ARP_CXX_SYMBOL_EXPORT std::istream & operator>> (std::istream &is, SocketError &value)
 

Detailed Description

Namespace for network specific classes, enumerations and functions.

Enumeration Type Documentation

◆ PollMode

This enum is used to specifiy the poll mode of the <cref name="Socket::Poll" > operation.

Enumerator
None 

Not initialized.

Read 

Read operation should be polled.

Write 

Write operation should be polled.

Connect 

Connect operation should be polled.

Accept 

Accept operation should be polled.

◆ SelectMode

Modes for Select call to check different data channels.

Enumerator
Read 

Check if data is available for reading.

Write 

Check if data can be written to socket.

Connect 

Check if a connect request can be performed.

Accept 

Check if a connection request is pending.

◆ ShutdownMode

This enum is used to specifiy the shutdown mode of the <cref name="Socket::Shutdown(ShutdownMode)" > operation.

Enumerator
None 

Not initialized.

Read 

Read operations should be shut down.

Write 

Write operations should be shut down.

ReadWrite 

Read and write operations should be shut down.

◆ SocketBlockingMode

Supported blocking modes.

Enumerator
None 

Blocking mode is undefined.

Blocking 

Socket is in blocking mode, i.e. the Send*, Receive* and Accept methods will block if no data is available.

NoneBlocking 

Socket is in non-blocking mode, i.e. the Send*, Receive* and Accept methods will not block if no data is available.

◆ SocketDomain

Supported communication domains, selecting the protocol for communication.

Enumerator
None 

Undefined domain.

Ipv4 

Communication is based on internet protocol version 4.

Ipv6 

Communication is based on internet protocol version 6 (not supported yet).

◆ SocketError

Possible error codes for socket operation results.

Enumerator
None 

The Socket operation succeeded.

Any 

An unspecified Socket error has occurred.

Interrupted 

A blocking operation was interrupted.

InvalidArgument 

An invalid argument was supplied.

TooManyOpenSockets 

Too many open sockets.

WouldBlock 

A non-blocking socket operation could not be completed immediately.

InProgress 

A blocking operation is currently executing.

AlreadyInProgress 

An operation was attempted on a non-blocking socket that already had an operation in progress.

NotSocket 

An operation was attempted on something that is not a socket.

DestinationAddressRequired 

A required address was omitted from an operation on a socket.

MessageSize 

A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.

ProtoType 

A protocol was specified in the socket function call that does not support the semantics of the socket type requested.

ProtocolOption 

An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call.

ProtocolNotSupported 

The requested protocol has not been configured into the system, or no implementation for it exists.

SocketNotSupported 

The support for the specified socket type does not exist in this address family.

OperationNotSupported 

The attempted operation is not supported for the type of object referenced.

ProtocolFamilyNotSupported 

The protocol family has not been configured into the system or no implementation for it exists.

AddressFamilyNotSupported 

An address incompatible with the requested protocol was used.

AddressAlreadyInUse 

Only one usage of each socket address (protocol/network address/port) is normally permitted.

AddressNotAvailable 

The requested address is not valid in its context.

NetworkDown 

A socket operation encountered a dead network.

NetworkUnreachable 

A socket operation was attempted to an unreachable network.

NetworkReset 

The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.

ConnectionAborted 

An established connection was aborted by the software in your host machine.

ConnectionReset 

An existing connection was forcibly closed by the remote host.

NoBufferSpaceAvailable 

An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.

IsConnected 

A connect request was made on an already connected socket.

NotConnected 

A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.

Shutdown 

A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call.

TimedOut 

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

ConnectionRefused 

No connection could be made because the target machine actively refused it.

HostDown 

A socket operation failed because the destination host was down.

HostUnreachable 

A socket operation was attempted to an unreachable host.

ProcessLimit 

A Sockets implementation may have a limit on the number of applications that may use it simultaneously.

SystemNotReady 

Startup cannot function at this time because the underlying system it uses to provide network services is currently unavailable.

VersionNotSupported 

The Sockets version requested is not supported.

NotInitialized 

Either the application has not called Startup, or Startup failed.

Disconnecting 

Returned by Recv or RecvFrom to indicate the remote party has initiated a graceful shutdown sequence.

HostNotFound 

No such host is known.

TryAgain 

This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server.

◆ SocketOptionName

Specifies socket options to be set by the application. Copied from Eclr Socket Adaption

Enumerator
SocketOptionReuseAddress 

Allows the socket to be bound to an address that is already in use, values:

  • 0 means the reuse of addresses is disabled
  • 1 means the reuse of addresses is enabled
SocketOptionKeepAlive 

Send keep-alive signals, values:

  • 0 means the keep alive option is disabled
  • 1 means the keep alive option is enabled
SocketOptionBroadcast 

Permit sending broadcast messages on the socket, values:

  • 0 means broadcasting is disabled
  • 1 means broadcasting is enabled
SocketOptionReceiveTimeout 

Sets the receiving timeout until reporting an error. The Argument is a struct timeval

SocketOptionSendTimeout 

Sets the sending timeout until reporting an error. The Argument is a struct timeval

SocketOptionNoDelay 

Enables or disables the Nagle algorithm for send coalescing, values:

  • 0 means NoDelay is disabled, that is the nagle algorithm is enabled.
  • 1 means NoDelay is enabled, that is the nagle algorithm is disabled.

◆ SocketType

Enumeration of supported socket types.

Enumerator
None 

Undefined socket type.

Tcp 

Socket uses TCP protocol.

Udp 

Socket uses UDP protocol.

Function Documentation

◆ operator<<()

std::ostream& Arp::System::Commons::Net::operator<< ( std::ostream &  os,
const IpAddress ipAddress 
)
inline

The ostream operator is used for logging and string formatting.

◆ operator>>()

std::istream& Arp::System::Commons::Net::operator>> ( std::istream &  is,
IpAddress ipAddress 
)
inline

The istream operator is used for string parsing.