PLCnext API Documentation 25.0.2.69
SocketError.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Core/Enum.hxx"
9
10namespace Arp { namespace System { namespace Commons { namespace Net
11{
12
14enum class SocketError
15{
17 None = 0,
19 Any = -1,
21 Interrupted = (10000 + 4), //WSAEINTR
23 InvalidArgument = (10000 + 22), //WSAEINVAL
25 TooManyOpenSockets = (10000 + 24), //WSAEMFILE
27 WouldBlock = (10000 + 35), //WSAEWOULDBLOCK
29 InProgress = (10000 + 36), //WSAEINPROGRESS
31 AlreadyInProgress = (10000 + 37), //WSAEALREADY
33 NotSocket = (10000 + 38), //WSAENOTSOCK
35 DestinationAddressRequired = (10000 + 39), //WSAEDESTADDRREQ
40 MessageSize = (10000 + 40), //WSAEMSGSIZE
45 ProtoType = (10000 + 41), //WSAEPROTOTYPE
47 ProtocolOption = (10000 + 42), //WSAENOPROTOOPT
49 ProtocolNotSupported = (10000 + 43), //WSAEPROTONOSUPPORT
51 SocketNotSupported = (10000 + 44), //WSAESOCKTNOSUPPORT
53 OperationNotSupported = (10000 + 45), //WSAEOPNOTSUPP
55 ProtocolFamilyNotSupported = (10000 + 46), //WSAEPFNOSUPPORT
57 AddressFamilyNotSupported = (10000 + 47), //WSAEAFNOSUPPORT
59 AddressAlreadyInUse = (10000 + 48), //WSAEADDRINUSE
61 AddressNotAvailable = (10000 + 49), //WSAEADDRNOTAVAIL
63 NetworkDown = (10000 + 50), //WSAENETDOWN
65 NetworkUnreachable = (10000 + 51), //WSAENETUNREACH
67 NetworkReset = (10000 + 52), //WSAENETRESET
69 ConnectionAborted = (10000 + 53), //WSAECONNABORTED
71 ConnectionReset = (10000 + 54), //WSAECONNRESET
73 NoBufferSpaceAvailable = (10000 + 55), //WSAENOBUFS
75 IsConnected = (10000 + 56), //WSAEISCONN
80 NotConnected = (10000 + 57), //WSAENOTCONN
85 Shutdown = (10000 + 58), //WSAESHUTDOWN
90 TimedOut = (10000 + 60), //WSAETIMEDOUT
92 ConnectionRefused = (10000 + 61), //WSAECONNREFUSED
94 HostDown = (10000 + 64), //WSAEHOSTDOWN
96 HostUnreachable = (10000 + 65), //WSAEHOSTUNREACH
98 ProcessLimit = (10000 + 67), //WSAEPROCLIM
103 SystemNotReady = (10000 + 91), //WSASYSNOTREADY
105 VersionNotSupported = (10000 + 92), //WSAVERNOTSUPPORTED
107 NotInitialized = (10000 + 93), //WSANOTINITIALISED
109 Disconnecting = (10000 + 101), //WSAEDISCON
111 HostNotFound = (10000 + 1001), //WSAHOST_NOT_FOUND
116 TryAgain = (10000 + 1002) //WSATRY_AGAIN
117};
118
120// global stream operators of enum SocketError for logging and parsing
121ARP_CXX_SYMBOL_EXPORT std::ostream& operator<<(std::ostream& os, SocketError value);
122ARP_CXX_SYMBOL_EXPORT std::istream& operator>>(std::istream& is, SocketError& value);
123
124}}}} // end of namespace Arp::System::Commons::Net
125
126template<> struct fmt::formatter<Arp::System::Commons::Net::SocketError>: public fmt::ostream_formatter {};
@ InvalidArgument
The input argument of the encoding operation is invalid.
@ SocketNotSupported
The support for the specified socket type does not exist in this address family.
@ ProtoType
A protocol was specified in the socket function call that does not support the semantics of the socke...
@ Disconnecting
Returned by Recv or RecvFrom to indicate the remote party has initiated a graceful shutdown sequence.
@ Interrupted
A blocking operation was interrupted.
@ InProgress
A blocking operation is currently executing.
@ ProtocolFamilyNotSupported
The protocol family has not been configured into the system or no implementation for it exists.
@ NotSocket
An operation was attempted on something that is not a socket.
@ Shutdown
A request to send or receive data was disallowed because the socket had already been shut down in tha...
@ AddressFamilyNotSupported
An address incompatible with the requested protocol was used.
@ ProtocolOption
An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call.
@ DestinationAddressRequired
A required address was omitted from an operation on a socket.
@ SystemNotReady
Startup cannot function at this time because the underlying system it uses to provide network service...
@ AddressNotAvailable
The requested address is not valid in its context.
@ NotConnected
A request to send or receive data was disallowed because the socket is not connected and (when sendin...
@ NoBufferSpaceAvailable
An operation on a socket could not be performed because the system lacked sufficient buffer space or ...
@ ProcessLimit
A Sockets implementation may have a limit on the number of applications that may use it simultaneousl...
@ IsConnected
A connect request was made on an already connected socket.
@ HostDown
A socket operation failed because the destination host was down.
@ NetworkUnreachable
A socket operation was attempted to an unreachable network.
@ AlreadyInProgress
An operation was attempted on a non-blocking socket that already had an operation in progress.
@ MessageSize
A message sent on a datagram socket was larger than the internal message buffer or some other network...
@ HostUnreachable
A socket operation was attempted to an unreachable host.
@ ProtocolNotSupported
The requested protocol has not been configured into the system, or no implementation for it exists.
@ TimedOut
A connection attempt failed because the connected party did not properly respond after a period of ti...
@ NotInitialized
Either the application has not called Startup, or Startup failed.
@ NetworkReset
The connection has been broken due to keep-alive activity detecting a failure while the operation was...
@ ConnectionRefused
No connection could be made because the target machine actively refused it.
@ ConnectionReset
An existing connection was forcibly closed by the remote host.
@ AddressAlreadyInUse
Only one usage of each socket address (protocol/network address/port) is normally permitted.
@ VersionNotSupported
The Sockets version requested is not supported.
@ OperationNotSupported
The attempted operation is not supported for the type of object referenced.
@ NetworkDown
A socket operation encountered a dead network.
@ WouldBlock
A non-blocking socket operation could not be completed immediately.
@ ConnectionAborted
An established connection was aborted by the software in your host machine.
@ TryAgain
This is usually a temporary error during host name resolution and means that the local server did not...
@ Any
An unspecified Socket error has occurred.
@ TooManyOpenSockets
Too many open sockets.
std::ostream & operator<<(std::ostream &os, const IpAddress &ipAddress)
The ostream operator is used for logging and string formatting.
Definition: IpAddress.cpp:76
std::istream & operator>>(std::istream &is, IpAddress &ipAddress)
The istream operator is used for string parsing.
Definition: IpAddress.cpp:83
SocketError
Possible error codes for socket operation results.
Definition: SocketError.hpp:15
Root namespace for the PLCnext API