PLCnext API Documentation 24.6.0.58
Classes | Public Types | Public Member Functions | List of all members
Arp::System::Ve::ISocketService Class Referenceabstract
Inheritance diagram for Arp::System::Ve::ISocketService:
Inheritance graph

Classes

struct  PeerCredentials
 

Public Types

enum class  SocketType { None = 0 , Tcp = 1 , Udp = 2 }
 
enum class  SocketDomain { None = 0 , Ipv4 = 1 , Ipv6 = 2 , Local }
 
enum class  SocketBlockingMode { None = 0 , Blocking = 1 , NoneBlocking = 2 }
 
enum class  SelectMode { SelectRead = 0 , SelectWrite = 1 , SelectConnect = 3 , SelectAccept = 4 }
 
enum class  PollMode {
  None = 0 , Read = 1 , Write = 2 , Connect = 3 ,
  Accept = 4
}
 
enum class  ShutdownMode { Read = 0 , Write = 1 , ReadWrite = 2 }
 
enum class  SocketOptionName {
  SocketOptionReuseAddress = 0x0004 , SocketOptionKeepAlive = 0x0008 , SocketOptionBroadcast = 0x0020 , SocketOptionLinger = 0x0080 ,
  SocketOptionReceiveTimeout = 0x0200 , SocketOptionSendTimeout = 0x0800 , SocketOptionNoDelay = 1 , SocketOptionPeerCredentials = 2 ,
  SocketOptionUserTimeout = 100 , SocketOptionKeepAliveIdleTime = 101 , SocketOptionKeepAliveProbeInterval = 102 , SocketOptionKeepAliveProbeCount = 103
}
 Specifies socket options to be set by the application. Copied from Eclr Socket Adaption More...
 
enum class  SocketError {
  Success = 0 , Unspecified = -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)
}
 

Public Member Functions

virtual SocketError Bind (uint32 ip4Address, int &port)=0
 
virtual SocketError Bind (const String &path)=0
 
virtual ISocketServiceAccept (uint32 &ip4Address, int &port, SocketError &error)=0
 
virtual ISocketServiceAccept (String &path, SocketError &error)=0
 
virtual SocketError Connect (uint32 ip4Address, int port)=0
 
virtual SocketError Connect (const String &path)=0
 
virtual SocketError Listen (int backlog)=0
 
virtual SocketError SetSockOpt (SocketOptionName optionName, const void *optionValue, size_t optionLength)=0
 
virtual SocketError GetSockOpt (SocketOptionName optionName, void *optionValue, size_t *optionLength)=0
 
virtual int Select (SelectMode mode, size_t timeout_us, SocketError &error)=0
 
virtual int Poll (PollMode mode, size_t timeoutMillis, SocketError &error)=0
 
virtual SocketError Close (void)=0
 
virtual SocketError Shutdown (void)=0
 
virtual SocketError Shutdown (ShutdownMode mode)=0
 
virtual int Send (const void *pBuffer, size_t len, SocketError &error)=0
 
virtual int SendTo (const void *pBuffer, size_t len, SocketError &error, uint32 ip4Address, int port)=0
 
virtual int Recv (void *pBuffer, size_t len, SocketError &error)=0
 
virtual int RecvFrom (void *pBuffer, size_t len, SocketError &error, uint32 &ip4Address, int &port)=0
 
virtual SocketError SetOptionBlocking (bool enable)=0
 
virtual SocketError SetOptionLinger (bool enable, size_t timeout)=0
 
virtual SocketError GetOptionLinger (bool &enable, size_t &timeout)=0
 
virtual SocketError SetOptionUserTimeout (size_t timeout_ms)=0
 
virtual SocketError GetOptionUserTimeout (size_t &timeout_ms)=0
 
virtual SocketError SetOptionKeepAliveIdleTime (int seconds)=0
 
virtual SocketError GetOptionKeepAliveIdleTime (int &seconds)=0
 
virtual SocketError SetOptionKeepAliveProbeInterval (int seconds)=0
 
virtual SocketError GetOptionKeepAliveProbeInterval (int &seconds)=0
 
virtual SocketError SetOptionKeepAliveProbeCount (int probeCount)=0
 
virtual SocketError GetOptionKeepAliveProbeCount (int &probeCount)=0
 
virtual intptr GetNativeHandle () const =0
 
virtual PeerCredentials GetPeerCredentials (SocketError &error)=0
 
- Public Member Functions inherited from Arp::System::Ve::IServiceObject
virtual const StringGetServiceDescription (void) const =0
 
virtual ServiceType GetServiceType (void) const =0
 

Member Enumeration Documentation

◆ ShutdownMode

Enumerator
Read 

Shutdown recv.

Write 

Shutdown send.

ReadWrite 

Shutdown recv and send.

◆ SocketError

Enumerator
Success 

The Socket operation succeeded.

Unspecified 

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
SocketOptionLinger 

Sets the timeout for closed sockets waiting for last incoming data.

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.
SocketOptionPeerCredentials 

Fetches the peer's credentials. Only works with Linux IpcSockets.

SocketOptionUserTimeout 

Sets the retransmission phase timeout in milliseconds for this socket.

This will set or get the TCP_USER_TIMEOUT socket option on Linux. If not set, if the socket enters a retransmission phase, its backoff algorithm will use the "tcp_retries2" value set on the device which can generally prevent the socket from becoming idle for 13-30 minutes. This will in turn result in KeepAlive being able to start until after the retransmission phase has ended. TCP_USER_TIMEOUT enables being able to interrupt this phase, based on the timeout that is set.

SocketOptionKeepAliveIdleTime 

Sets the period of time that the socket has to be idle for, before Keep Alive probes start being sent.

Sets or gets the TCP_KEEPIDLE socket option.

SocketOptionKeepAliveProbeInterval 

Sets the time between each Keep Alive probe.

Sets or gets the TCP_KEEPINTVL socket option.

SocketOptionKeepAliveProbeCount 

Sets the number of Keep Alive probes to be sent.

Sets or gets the TCP_KEEPCNT socket option.


The documentation for this class was generated from the following file: