System::Net::Sockets::Socket Class Reference

The Socket class implements the Berkeley sockets interface. More...

Inherits System::IDisposable.

Public Types

typedef std::shared_ptr< System::Details::socket_impl > ImplPtr
 The socket implementation. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

ASPOSECPP_SHARED_API int32_t get_Available ()
 Gets the number of bytes received from the network and available for reading. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< EndPointget_LocalEndPoint ()
 Returns the local endpoint. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< EndPointget_RemoteEndPoint ()
 Returns the remote endpoint. More...
 
ASPOSECPP_SHARED_API bool get_Blocking ()
 Gets a value that indicates if the socket is in the blocking mode. More...
 
ASPOSECPP_SHARED_API void set_Blocking (bool value)
 Sets a value that indicates if the socket is in the blocking mode. More...
 
ASPOSECPP_SHARED_API bool get_Connected ()
 Returns a value that indicates if the socket is connected to the remote host. More...
 
ASPOSECPP_SHARED_API System::Net::Sockets::AddressFamily get_AddressFamily ()
 Returns the address family. More...
 
ASPOSECPP_SHARED_API System::Net::Sockets::SocketType get_SocketType ()
 Returns the socket type. More...
 
ASPOSECPP_SHARED_API System::Net::Sockets::ProtocolType get_ProtocolType ()
 Returns the protocol type. More...
 
ASPOSECPP_SHARED_API bool get_IsBound ()
 Returns a value that indicates if the socket is bound to a specific local port. More...
 
ASPOSECPP_SHARED_API bool get_ExclusiveAddressUse ()
 Gets a value that indicates if only one process can bind the socket to a port. More...
 
ASPOSECPP_SHARED_API void set_ExclusiveAddressUse (bool value)
 Sets a value that indicates if only one process can bind the socket to a port. More...
 
ASPOSECPP_SHARED_API int32_t get_ReceiveBufferSize ()
 Gets the receive buffer size. More...
 
ASPOSECPP_SHARED_API void set_ReceiveBufferSize (int32_t value)
 Sets the receive buffer size. More...
 
ASPOSECPP_SHARED_API int32_t get_SendBufferSize ()
 Gets the send buffer size. More...
 
ASPOSECPP_SHARED_API void set_SendBufferSize (int32_t value)
 Sets the send buffer size. More...
 
ASPOSECPP_SHARED_API int32_t get_ReceiveTimeout ()
 Gets a period after which a 'Receive' call will time out. More...
 
ASPOSECPP_SHARED_API void set_ReceiveTimeout (int32_t value)
 Sets a period after which a 'Receive' call will time out. More...
 
ASPOSECPP_SHARED_API int32_t get_SendTimeout ()
 Gets a period after which a 'Send' call will time out. More...
 
ASPOSECPP_SHARED_API void set_SendTimeout (int32_t value)
 Sets a period after which a 'Send' call will time out. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< LingerOptionget_LingerState ()
 Gets a value that indicates if the socket will delay closing in an attempt to send all pending data. More...
 
ASPOSECPP_SHARED_API void set_LingerState (System::SharedPtr< LingerOption > value)
 Sets a value that indicates if the socket will delay closing in an attempt to send all pending data. More...
 
ASPOSECPP_SHARED_API bool get_NoDelay ()
 Gets a value that indicates if the socket is using the Nagle algorithm. More...
 
ASPOSECPP_SHARED_API void set_NoDelay (bool value)
 Sets a value that indicates if the socket is using the Nagle algorithm. More...
 
ASPOSECPP_SHARED_API int16_t get_Ttl ()
 Gets the TTL value. More...
 
ASPOSECPP_SHARED_API void set_Ttl (int16_t value)
 Sets the TTL value. More...
 
ASPOSECPP_SHARED_API bool get_DontFragment ()
 Gets a value that indicates if the socket allows IP datagrams to be fragmented. More...
 
ASPOSECPP_SHARED_API void set_DontFragment (bool value)
 Sets a value that indicates if the socket allows IP datagrams to be fragmented. More...
 
ASPOSECPP_SHARED_API bool get_MulticastLoopback ()
 Gets a value that indicates if the socket receives outgoing multicast packets. More...
 
ASPOSECPP_SHARED_API void set_MulticastLoopback (bool value)
 Sets a value that indicates if the socket receives outgoing multicast packets. More...
 
ASPOSECPP_SHARED_API bool get_EnableBroadcast ()
 Gets a value that indicates if the socket allows broadcast packets. More...
 
ASPOSECPP_SHARED_API void set_EnableBroadcast (bool value)
 Sets a value that indicates if the socket allows broadcast packets. More...
 
ASPOSECPP_SHARED_API bool get_DualMode ()
 Gets a value indicates if the socket is in the dual-mode. More...
 
ASPOSECPP_SHARED_API void set_DualMode (bool value)
 Sets a value indicates if the socket is in the dual-mode. More...
 
ASPOSECPP_SHARED_API Socket (System::Net::Sockets::SocketType socketType, System::Net::Sockets::ProtocolType protocolType)
 Constructs a new instance. More...
 
ASPOSECPP_SHARED_API Socket (System::Net::Sockets::AddressFamily addressFamily, System::Net::Sockets::SocketType socketType, System::Net::Sockets::ProtocolType protocolType)
 Constructs a new instance. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginSend (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, AsyncCallback callback, System::SharedPtr< Object > state)
 Initiates an asynchronous send operation. More...
 
ASPOSECPP_SHARED_API int32_t EndSend (System::SharedPtr< IAsyncResult > asyncResult)
 Waits until the specified asynchronous send operation completes. More...
 
ASPOSECPP_SHARED_API int32_t EndSend (System::SharedPtr< IAsyncResult > asyncResult, SocketError &errorCode)
 Waits until the specified asynchronous send operation completes. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginReceive (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, AsyncCallback callback, System::SharedPtr< Object > state)
 Initiates an asynchronous write operation. More...
 
ASPOSECPP_SHARED_API int32_t EndReceive (System::SharedPtr< IAsyncResult > asyncResult)
 Waits until the specified asynchronous receive operation completes. More...
 
ASPOSECPP_SHARED_API int32_t EndReceive (System::SharedPtr< IAsyncResult > asyncResult, SocketError &errorCode)
 Waits until the specified asynchronous receive operation completes. More...
 
ASPOSECPP_SHARED_API void Bind (System::SharedPtr< EndPoint > localEP)
 Binds the socket with to the specified local endpoint. More...
 
ASPOSECPP_SHARED_API void Connect (System::SharedPtr< EndPoint > remoteEP)
 Establishes a connection to the specified remote endpoint. More...
 
ASPOSECPP_SHARED_API void Connect (System::SharedPtr< IPAddress > address, int32_t port)
 Establishes a connection to the specified remote endpoint. More...
 
ASPOSECPP_SHARED_API void Connect (String host, int32_t port)
 Establishes a connection to the specified remote endpoint. More...
 
ASPOSECPP_SHARED_API void Connect (System::ArrayPtr< System::SharedPtr< IPAddress >> addresses, int32_t port)
 Establishes a connection to the specified remote endpoint. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginConnect (System::SharedPtr< EndPoint > remoteEP, AsyncCallback callback, System::SharedPtr< Object > state)
 Initiates an asynchronous connect operation. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginConnect (String host, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
 Initiates an asynchronous connect operation. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginConnect (System::SharedPtr< IPAddress > address, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
 Initiates an asynchronous connect operation. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< IAsyncResultBeginConnect (System::ArrayPtr< System::SharedPtr< IPAddress >> addresses, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
 Initiates an asynchronous connect operation. More...
 
ASPOSECPP_SHARED_API void Close ()
 Closes the socket connection. More...
 
ASPOSECPP_SHARED_API void Close (int timeout)
 Closes the socket connection with the specified timeout to allow queued data to be sent. More...
 
ASPOSECPP_SHARED_API void EndConnect (System::SharedPtr< IAsyncResult > asyncResult)
 Waits until the specified asynchronous connect operation completes. More...
 
ASPOSECPP_SHARED_API void Listen (int32_t backlog)
 Changes the socket state to 'listen'. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< SocketAccept ()
 Creates a new socket for the newly created connection. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::ArrayPtr< uint8_t > buffer, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::Details::ArrayView< uint8_t > buffer, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
template<std::size_t N>
int32_t Send (System::Details::StackArray< uint8_t, N > &buffer, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::ArrayPtr< uint8_t > buffer, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::Details::ArrayView< uint8_t > buffer, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
template<std::size_t N>
int32_t Send (System::Details::StackArray< uint8_t, N > &buffer, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::ArrayPtr< uint8_t > buffer)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::Details::ArrayView< uint8_t > buffer)
 Sends the specified data to the socket. More...
 
template<std::size_t N>
int32_t Send (System::Details::StackArray< uint8_t, N > &buffer)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers, SocketFlags socketFlags, SocketError &errorCode)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
template<std::size_t N>
int32_t Send (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t Send (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Sends the specified data to the socket. More...
 
template<std::size_t N>
int32_t Send (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Sends the specified data to the socket. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
template<std::size_t N>
int32_t SendTo (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::ArrayPtr< uint8_t > buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::Details::ArrayView< uint8_t > buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
template<std::size_t N>
int32_t SendTo (System::Details::StackArray< uint8_t, N > &buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::ArrayPtr< uint8_t > buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::Details::ArrayView< uint8_t > buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
template<std::size_t N>
int32_t SendTo (System::Details::StackArray< uint8_t, N > &buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::ArrayPtr< uint8_t > buffer, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t SendTo (System::Details::ArrayView< uint8_t > buffer, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
template<std::size_t N>
int32_t SendTo (System::Details::StackArray< uint8_t, N > &buffer, System::SharedPtr< EndPoint > remoteEP)
 Sends the specified data to the specified endpoint. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::ArrayPtr< uint8_t > buffer, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::Details::ArrayView< uint8_t > buffer, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t Receive (System::Details::StackArray< uint8_t, N > &buffer, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::ArrayPtr< uint8_t > buffer, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::Details::ArrayView< uint8_t > buffer, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t Receive (System::Details::StackArray< uint8_t, N > &buffer, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::ArrayPtr< uint8_t > buffer)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::Details::ArrayView< uint8_t > buffer)
 Receives data from the socket and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t Receive (System::Details::StackArray< uint8_t, N > &buffer)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t Receive (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Receives data from the socket and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t Receive (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags, SocketError &errorCode)
 Receives data from the socket and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers)
 Receives data from the socket and writes it to the specified byte arrays. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers, SocketFlags socketFlags)
 Receives data from the socket and writes it to the specified byte arrays. More...
 
ASPOSECPP_SHARED_API int32_t Receive (System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>> buffers, SocketFlags socketFlags, SocketError &errorCode)
 Receives data from the socket and writes it to the specified byte arrays. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveMessageFrom (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags &socketFlags, System::SharedPtr< EndPoint > &remoteEP, IPPacketInformation &ipPacketInformation)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveMessageFrom (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags &socketFlags, System::SharedPtr< EndPoint > &remoteEP, IPPacketInformation &ipPacketInformation)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t ReceiveMessageFrom (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags &socketFlags, System::SharedPtr< EndPoint > &remoteEP, IPPacketInformation &ipPacketInformation)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::Details::ArrayView< uint8_t > buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t ReceiveFrom (System::Details::StackArray< uint8_t, N > &buffer, int32_t offset, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::ArrayPtr< uint8_t > buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::Details::ArrayView< uint8_t > buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t ReceiveFrom (System::Details::StackArray< uint8_t, N > &buffer, int32_t size, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::ArrayPtr< uint8_t > buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::Details::ArrayView< uint8_t > buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t ReceiveFrom (System::ArrayPtr< uint8_t > buffer, SocketFlags socketFlags, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::ArrayPtr< uint8_t > buffer, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t ReceiveFrom (System::Details::ArrayView< uint8_t > buffer, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
template<std::size_t N>
int32_t ReceiveFrom (System::Details::StackArray< uint8_t, N > &buffer, System::SharedPtr< EndPoint > &remoteEP)
 Receives data from the specified endpoint and writes it to the specified byte array. More...
 
ASPOSECPP_SHARED_API int32_t IOControl (int32_t ioControlCode, System::ArrayPtr< uint8_t > optionInValue, System::ArrayPtr< uint8_t > optionOutValue)
 Sets low-level operating modes for the socket. More...
 
ASPOSECPP_SHARED_API int32_t IOControl (IOControlCode ioControlCode, System::ArrayPtr< uint8_t > optionInValue, System::ArrayPtr< uint8_t > optionOutValue)
 Sets low-level operating modes for the socket. More...
 
ASPOSECPP_SHARED_API void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int32_t optionValue)
 Sets the specified socket option to the specified value. More...
 
ASPOSECPP_SHARED_API void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, System::ArrayPtr< uint8_t > optionValue)
 Sets the specified socket option to the specified value. More...
 
ASPOSECPP_SHARED_API void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
 Sets the specified socket option to the specified value. More...
 
ASPOSECPP_SHARED_API void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, System::SharedPtr< Object > optionValue)
 Sets the specified socket option to the specified value. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< ObjectGetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName)
 Returns the value that corresponds to the specified option name. More...
 
ASPOSECPP_SHARED_API void GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, System::ArrayPtr< uint8_t > optionValue)
 Gets the value that corresponds to the specified option name. More...
 
ASPOSECPP_SHARED_API System::ArrayPtr< uint8_t > GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int32_t optionLength)
 Returns the value that corresponds to the specified option name. More...
 
ASPOSECPP_SHARED_API bool Poll (int32_t microSeconds, SelectMode mode)
 Returns the status of the socket based on the specified polling mode. More...
 
ASPOSECPP_SHARED_API void Shutdown (SocketShutdown how)
 Disables the send and receive operations of the socket. More...
 
ASPOSECPP_SHARED_API void Dispose () override
 Does nothing. More...
 
virtual ASPOSECPP_SHARED_API ~Socket ()
 Destructs the current instance. More...
 
ImplPtr GetImpl () const
 Returns a pointer to implementation. More...
 
ASPOSECPP_SHARED_API void set_ConnectionTimeout (int32_t value)
 Sets the connection timeout. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static ASPOSECPP_SHARED_API bool get_SupportsIPv4 ()
 Returns a value that indicates if the current host supports IPv4. More...
 
static ASPOSECPP_SHARED_API bool get_OSSupportsIPv4 ()
 Returns a value that indicates if the operating system and network adaptors support IPv4. More...
 
static ASPOSECPP_SHARED_API bool get_OSSupportsIPv6 ()
 Returns a value that indicates if the operating system and network adaptors support IPv6. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

The Socket class implements the Berkeley sockets interface.

Member Typedef Documentation

◆ ImplPtr

typedef std::shared_ptr<System::Details::socket_impl> System::Net::Sockets::Socket::ImplPtr

The socket implementation.

Constructor & Destructor Documentation

◆ Socket() [1/2]

ASPOSECPP_SHARED_API System::Net::Sockets::Socket::Socket ( System::Net::Sockets::SocketType  socketType,
System::Net::Sockets::ProtocolType  protocolType 
)

Constructs a new instance.

Parameters
socketTypeThe socket type.
protocolTypeThe protocol type.

◆ Socket() [2/2]

ASPOSECPP_SHARED_API System::Net::Sockets::Socket::Socket ( System::Net::Sockets::AddressFamily  addressFamily,
System::Net::Sockets::SocketType  socketType,
System::Net::Sockets::ProtocolType  protocolType 
)

Constructs a new instance.

Parameters
addressFamilyThe address family.
socketTypeThe socket type.
protocolTypeThe protocol type.

◆ ~Socket()

virtual ASPOSECPP_SHARED_API System::Net::Sockets::Socket::~Socket ( )
virtual

Destructs the current instance.

Member Function Documentation

◆ Accept()

ASPOSECPP_SHARED_API System::SharedPtr<Socket> System::Net::Sockets::Socket::Accept ( )

Creates a new socket for the newly created connection.

Returns
A new socket for the newly created connection.

◆ BeginConnect() [1/4]

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect ( System::SharedPtr< EndPoint remoteEP,
AsyncCallback  callback,
System::SharedPtr< Object state 
)

Initiates an asynchronous connect operation.

Parameters
remoteEPThe remote endpoint.
callbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous connect operation.
Returns
An IAsyncResult object representing the initiated asynchronous connect operation.

◆ BeginConnect() [2/4]

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect ( String  host,
int32_t  port,
AsyncCallback  requestCallback,
System::SharedPtr< Object state 
)

Initiates an asynchronous connect operation.

Parameters
hostThe remote host name.
portThe port number of the remote host.
requestCallbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous connect operation.
Returns
An IAsyncResult object representing the initiated asynchronous connect operation.

◆ BeginConnect() [3/4]

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect ( System::SharedPtr< IPAddress address,
int32_t  port,
AsyncCallback  requestCallback,
System::SharedPtr< Object state 
)

Initiates an asynchronous connect operation.

Parameters
addressThe remote host IP address.
portThe port number of the remote host.
requestCallbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous connect operation.
Returns
An IAsyncResult object representing the initiated asynchronous connect operation.

◆ BeginConnect() [4/4]

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect ( System::ArrayPtr< System::SharedPtr< IPAddress >>  addresses,
int32_t  port,
AsyncCallback  requestCallback,
System::SharedPtr< Object state 
)

Initiates an asynchronous connect operation.

Parameters
addressesThe IP addresses of the remote host.
portThe port number of the remote host.
requestCallbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous connect operation.
Returns
An IAsyncResult object representing the initiated asynchronous connect operation.

◆ BeginReceive()

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginReceive ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
AsyncCallback  callback,
System::SharedPtr< Object state 
)

Initiates an asynchronous write operation.

Parameters
bufferA buffer where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe receive behaviour.
callbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous receive operation.
Returns
An IAsyncResult object representing the initiated asynchronous receive operation.

◆ BeginSend()

ASPOSECPP_SHARED_API System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginSend ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
AsyncCallback  callback,
System::SharedPtr< Object state 
)

Initiates an asynchronous send operation.

Parameters
bufferA buffer to read data from.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behaviour.
callbackA callback that will be called when the operation completes.
stateUser-provided data used to uniquely identify each asynchronous send operation.
Returns
An IAsyncResult object representing the initiated asynchronous send operation.

◆ Bind()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Bind ( System::SharedPtr< EndPoint localEP)

Binds the socket with to the specified local endpoint.

Parameters
localEPThe local endpoint to which the socket is bound.

◆ Close() [1/2]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Close ( )

Closes the socket connection.

◆ Close() [2/2]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Close ( int  timeout)

Closes the socket connection with the specified timeout to allow queued data to be sent.

Parameters
timeoutA number of milliseconds to wait.

◆ Connect() [1/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Connect ( System::SharedPtr< EndPoint remoteEP)

Establishes a connection to the specified remote endpoint.

Parameters
remoteEPThe remote endpoint.

◆ Connect() [2/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Connect ( System::SharedPtr< IPAddress address,
int32_t  port 
)

Establishes a connection to the specified remote endpoint.

Parameters
addressThe remote host IP address.
portThe port number of the remote host.

◆ Connect() [3/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Connect ( String  host,
int32_t  port 
)

Establishes a connection to the specified remote endpoint.

Parameters
hostThe remote host name.
portThe port number of the remote host.

◆ Connect() [4/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Connect ( System::ArrayPtr< System::SharedPtr< IPAddress >>  addresses,
int32_t  port 
)

Establishes a connection to the specified remote endpoint.

Parameters
addressesThe IP addresses of the remote host.
portThe port number of the remote host.

◆ Dispose()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Dispose ( )
overridevirtual

Does nothing.

Reimplemented from System::IDisposable.

◆ EndConnect()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::EndConnect ( System::SharedPtr< IAsyncResult asyncResult)

Waits until the specified asynchronous connect operation completes.

Parameters
asyncResultAn IAsyncResult object that represents an asynchronous connect operation.

◆ EndReceive() [1/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::EndReceive ( System::SharedPtr< IAsyncResult asyncResult)

Waits until the specified asynchronous receive operation completes.

Parameters
asyncResultAn IAsyncResult object that represents an asynchronous receive operation.
Returns
The number of bytes that are received.

◆ EndReceive() [2/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::EndReceive ( System::SharedPtr< IAsyncResult asyncResult,
SocketError errorCode 
)

Waits until the specified asynchronous receive operation completes.

Parameters
asyncResultAn IAsyncResult object that represents an asynchronous receive operation.
errorCodeThe output parameter where the error code will be assigned when the receive operation fails.
Returns
The number of received bytes.

◆ EndSend() [1/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::EndSend ( System::SharedPtr< IAsyncResult asyncResult)

Waits until the specified asynchronous send operation completes.

Parameters
asyncResultAn IAsyncResult object that represents an asynchronous send operation.
Returns
The number of sent bytes.

◆ EndSend() [2/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::EndSend ( System::SharedPtr< IAsyncResult asyncResult,
SocketError errorCode 
)

Waits until the specified asynchronous send operation completes.

Parameters
asyncResultAn IAsyncResult object that represents an asynchronous send operation.
errorCodeThe output parameter where the error code will be assigned when the send operation fails.
Returns
The number of sent bytes.

◆ get_AddressFamily()

ASPOSECPP_SHARED_API System::Net::Sockets::AddressFamily System::Net::Sockets::Socket::get_AddressFamily ( )

Returns the address family.

Returns
The address family.

◆ get_Available()

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::get_Available ( )

Gets the number of bytes received from the network and available for reading.

Returns
The number of bytes received from the network and available for reading.

◆ get_Blocking()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_Blocking ( )

Gets a value that indicates if the socket is in the blocking mode.

Returns
A value that indicates if the socket is in the blocking mode.

◆ get_Connected()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_Connected ( )

Returns a value that indicates if the socket is connected to the remote host.

Returns
A value that indicates if the socket is connected to the remote host.

◆ get_DontFragment()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_DontFragment ( )

Gets a value that indicates if the socket allows IP datagrams to be fragmented.

Returns
A value that indicates if the socket allows IP datagrams to be fragmented.

◆ get_DualMode()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_DualMode ( )

Gets a value indicates if the socket is in the dual-mode.

Returns
A value indicates if the socket is in the dual-mode.

◆ get_EnableBroadcast()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_EnableBroadcast ( )

Gets a value that indicates if the socket allows broadcast packets.

Returns
A value that indicates if the socket allows broadcast packets.

◆ get_ExclusiveAddressUse()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_ExclusiveAddressUse ( )

Gets a value that indicates if only one process can bind the socket to a port.

Returns
A value that indicates if only one process can bind the socket to a port.

◆ get_IsBound()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_IsBound ( )

Returns a value that indicates if the socket is bound to a specific local port.

Returns
A value that indicates if the socket is bound to a specific local port.

◆ get_LingerState()

ASPOSECPP_SHARED_API System::SharedPtr<LingerOption> System::Net::Sockets::Socket::get_LingerState ( )

Gets a value that indicates if the socket will delay closing in an attempt to send all pending data.

Returns
A value that indicates if the socket will delay closing in an attempt to send all pending data.

◆ get_LocalEndPoint()

ASPOSECPP_SHARED_API System::SharedPtr<EndPoint> System::Net::Sockets::Socket::get_LocalEndPoint ( )

Returns the local endpoint.

Returns
The local endpoint.

◆ get_MulticastLoopback()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_MulticastLoopback ( )

Gets a value that indicates if the socket receives outgoing multicast packets.

Returns
A value that indicates if the socket receives outgoing multicast packets.

◆ get_NoDelay()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_NoDelay ( )

Gets a value that indicates if the socket is using the Nagle algorithm.

Returns
A value that indicates if the socket is using the Nagle algorithm.

◆ get_OSSupportsIPv4()

static ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_OSSupportsIPv4 ( )
static

Returns a value that indicates if the operating system and network adaptors support IPv4.

Returns
A value that indicates if the operating system and network adaptors support IPv4.

◆ get_OSSupportsIPv6()

static ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_OSSupportsIPv6 ( )
static

Returns a value that indicates if the operating system and network adaptors support IPv6.

Returns
A value that indicates if the operating system and network adaptors support IPv6.

◆ get_ProtocolType()

ASPOSECPP_SHARED_API System::Net::Sockets::ProtocolType System::Net::Sockets::Socket::get_ProtocolType ( )

Returns the protocol type.

Returns
The protocol type.

◆ get_ReceiveBufferSize()

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::get_ReceiveBufferSize ( )

Gets the receive buffer size.

Returns
The receive buffer size.

◆ get_ReceiveTimeout()

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::get_ReceiveTimeout ( )

Gets a period after which a 'Receive' call will time out.

Returns
A period after which a 'Receive' call will time out.

◆ get_RemoteEndPoint()

ASPOSECPP_SHARED_API System::SharedPtr<EndPoint> System::Net::Sockets::Socket::get_RemoteEndPoint ( )

Returns the remote endpoint.

Returns
The remote endpoint.

◆ get_SendBufferSize()

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::get_SendBufferSize ( )

Gets the send buffer size.

Returns
The send buffer size.

◆ get_SendTimeout()

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::get_SendTimeout ( )

Gets a period after which a 'Send' call will time out.

Returns
A period after which a 'Send' call will time out.

◆ get_SocketType()

ASPOSECPP_SHARED_API System::Net::Sockets::SocketType System::Net::Sockets::Socket::get_SocketType ( )

Returns the socket type.

Returns
The socket type.

◆ get_SupportsIPv4()

static ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::get_SupportsIPv4 ( )
static

Returns a value that indicates if the current host supports IPv4.

Returns
A value that indicates if the current host supports IPv4.

◆ get_Ttl()

ASPOSECPP_SHARED_API int16_t System::Net::Sockets::Socket::get_Ttl ( )

Gets the TTL value.

Returns
The TTL value.

◆ GetImpl()

ImplPtr System::Net::Sockets::Socket::GetImpl ( ) const

Returns a pointer to implementation.

◆ GetSocketOption() [1/3]

ASPOSECPP_SHARED_API System::SharedPtr<Object> System::Net::Sockets::Socket::GetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName 
)

Returns the value that corresponds to the specified option name.

Parameters
optionLevelThe socket option level.
optionNameThe option name.
Returns
The value that corresponds to the specified option name.

◆ GetSocketOption() [2/3]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::GetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
System::ArrayPtr< uint8_t >  optionValue 
)

Gets the value that corresponds to the specified option name.

Parameters
optionLevelThe socket option level.
optionNameThe option name.
optionValueThe output parameter where the corresponding value will be assigned.

◆ GetSocketOption() [3/3]

ASPOSECPP_SHARED_API System::ArrayPtr<uint8_t> System::Net::Sockets::Socket::GetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
int32_t  optionLength 
)

Returns the value that corresponds to the specified option name.

Parameters
optionLevelThe socket option level.
optionNameThe option name.
optionLengthThe option length.
Returns
The value that corresponds to the specified option name.

◆ IOControl() [1/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::IOControl ( int32_t  ioControlCode,
System::ArrayPtr< uint8_t >  optionInValue,
System::ArrayPtr< uint8_t >  optionOutValue 
)

Sets low-level operating modes for the socket.

Parameters
ioControlCodeThe control code of the operation to perform.
optionInValueThe byte array that contains the input data.
optionOutValueThe byte array that contains the output data.
Returns
The number of bytes in the optionOutValue parameter.

◆ IOControl() [2/2]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::IOControl ( IOControlCode  ioControlCode,
System::ArrayPtr< uint8_t >  optionInValue,
System::ArrayPtr< uint8_t >  optionOutValue 
)

Sets low-level operating modes for the socket.

Parameters
ioControlCodeThe control code of the operation to perform.
optionInValueThe byte array that contains the input data.
optionOutValueThe byte array that contains the output data.
Returns
The number of bytes in the optionOutValue parameter.

◆ Listen()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Listen ( int32_t  backlog)

Changes the socket state to 'listen'.

Parameters
backlogThe maximum number of pending connections.

◆ Poll()

ASPOSECPP_SHARED_API bool System::Net::Sockets::Socket::Poll ( int32_t  microSeconds,
SelectMode  mode 
)

Returns the status of the socket based on the specified polling mode.

Parameters
microSecondsThe amount of time in milliseconds to wait for a response.
modeThe polling mode.
Returns
The status of the socket based on the specified polling mode.

◆ Receive() [1/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::ArrayPtr< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [2/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [3/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Receive ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  size,
SocketFlags  socketFlags 
)
inline

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [4/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::ArrayPtr< uint8_t >  buffer,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [5/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::Details::ArrayView< uint8_t >  buffer,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [6/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Receive ( System::Details::StackArray< uint8_t, N > &  buffer,
SocketFlags  socketFlags 
)
inline

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [7/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::ArrayPtr< uint8_t >  buffer)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
Returns
The number of received bytes.

◆ Receive() [8/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::Details::ArrayView< uint8_t >  buffer)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
Returns
The number of received bytes.

◆ Receive() [9/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Receive ( System::Details::StackArray< uint8_t, N > &  buffer)
inline

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
Returns
The number of received bytes.

◆ Receive() [10/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [11/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [12/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Receive ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)
inline

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
Returns
The number of received bytes.

◆ Receive() [13/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
errorCodeThe output parameter where the error code will be assigned when the receive operation fails.
Returns
The number of received bytes.

◆ Receive() [14/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
errorCodeThe output parameter where the error code will be assigned when the receive operation fails.
Returns
The number of received bytes.

◆ Receive() [15/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Receive ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)
inline

Receives data from the socket and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
errorCodeThe output parameter where the error code will be assigned when the receive operation fails.
Returns
The number of received bytes.

◆ Receive() [16/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers)

Receives data from the socket and writes it to the specified byte arrays.

Parameters
buffersThe byte arrays where the received data will be assigned.
Returns
The number of bytes that are received.

◆ Receive() [17/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers,
SocketFlags  socketFlags 
)

Receives data from the socket and writes it to the specified byte arrays.

Parameters
buffersThe byte arrays where the received data will be assigned.
socketFlagsThe receive behaviour.
Returns
The number of received bytes.

◆ Receive() [18/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Receive ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers,
SocketFlags  socketFlags,
SocketError errorCode 
)

Receives data from the socket and writes it to the specified byte arrays.

Parameters
buffersThe byte arrays where the received data will be assigned.
socketFlagsThe receive behaviour.
errorCodeThe output parameter where the error code will be assigned when the receive operation fails.
Returns
The number of received bytes.

◆ ReceiveFrom() [1/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [2/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [3/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)
inline

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [4/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::ArrayPtr< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [5/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [6/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)
inline

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [7/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::ArrayPtr< uint8_t >  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [8/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::ArrayView< uint8_t >  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [9/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::ArrayPtr< uint8_t >  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint > &  remoteEP 
)
inline

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [10/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::ArrayPtr< uint8_t >  buffer,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [11/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::ArrayView< uint8_t >  buffer,
System::SharedPtr< EndPoint > &  remoteEP 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveFrom() [12/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::ReceiveFrom ( System::Details::StackArray< uint8_t, N > &  buffer,
System::SharedPtr< EndPoint > &  remoteEP 
)
inline

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
remoteEPThe remote endpoint.
Returns
The number of received bytes.

◆ ReceiveMessageFrom() [1/3]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveMessageFrom ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags socketFlags,
System::SharedPtr< EndPoint > &  remoteEP,
IPPacketInformation ipPacketInformation 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
ipPacketInformationThe output parameter where information about the packet will be assigned.
Returns
The number of received bytes.

◆ ReceiveMessageFrom() [2/3]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::ReceiveMessageFrom ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags socketFlags,
System::SharedPtr< EndPoint > &  remoteEP,
IPPacketInformation ipPacketInformation 
)

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
ipPacketInformationThe output parameter where information about the packet will be assigned.
Returns
The number of received bytes.

◆ ReceiveMessageFrom() [3/3]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::ReceiveMessageFrom ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags socketFlags,
System::SharedPtr< EndPoint > &  remoteEP,
IPPacketInformation ipPacketInformation 
)
inline

Receives data from the specified endpoint and writes it to the specified byte array.

Parameters
bufferThe byte array where the received data will be assigned.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes to receive that will be assigned to the specified byte array from the 'offset' index.
socketFlagsThe receive behavior.
remoteEPThe remote endpoint.
ipPacketInformationThe output parameter where information about the packet will be assigned.
Returns
The number of received bytes.

◆ Send() [1/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::ArrayPtr< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
sizeThe number of bytes from the specified data that must be send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [2/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
sizeThe number of bytes from the specified data that must be send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [3/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Send ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  size,
SocketFlags  socketFlags 
)
inline

Sends the specified data to the socket.

Parameters
bufferThe data to send.
sizeThe number of bytes from the specified data that must be send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [4/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::ArrayPtr< uint8_t >  buffer,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [5/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::Details::ArrayView< uint8_t >  buffer,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [6/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Send ( System::Details::StackArray< uint8_t, N > &  buffer,
SocketFlags  socketFlags 
)
inline

Sends the specified data to the socket.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [7/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::ArrayPtr< uint8_t >  buffer)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
Returns
The number of sent bytes.

◆ Send() [8/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::Details::ArrayView< uint8_t >  buffer)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
Returns
The number of sent bytes.

◆ Send() [9/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Send ( System::Details::StackArray< uint8_t, N > &  buffer)
inline

Sends the specified data to the socket.

Parameters
bufferThe data to send.
Returns
The number of sent bytes.

◆ Send() [10/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers)

Sends the specified data to the socket.

Parameters
buffersA collection of byte arrays from which data must be sent.
Returns
The number of sent bytes.

◆ Send() [11/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
buffersA collection of byte arrays from which data must be sent.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [12/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::SharedPtr< Collections::Generic::IList< ArraySegment< uint8_t >>>  buffers,
SocketFlags  socketFlags,
SocketError errorCode 
)

Sends the specified data to the socket.

Parameters
buffersA collection of byte arrays from which data must be sent.
socketFlagsThe send behavior.
errorCodeThe output parameter where the error code will be assigned when the send operation fails.
Returns
The number of sent bytes.

◆ Send() [13/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [14/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [15/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Send ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags 
)
inline

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
Returns
The number of sent bytes.

◆ Send() [16/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
errorCodeThe output parameter where the error code will be assigned when the send operation fails.
Returns
The number of sent bytes.

◆ Send() [17/18]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::Send ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
errorCodeThe output parameter where the error code will be assigned when the send operation fails.
Returns
The number of sent bytes.

◆ Send() [18/18]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::Send ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
SocketError errorCode 
)
inline

Sends the specified data to the socket.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
errorCodeThe output parameter where the error code will be assigned when the send operation fails.
Returns
The number of sent bytes.

◆ SendTo() [1/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::ArrayPtr< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [2/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [3/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::SendTo ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  offset,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)
inline

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
offsetThe offset in bytes in the specified array.
sizeThe number of bytes in the specified array starting from the 'offset' parameter.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [4/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::ArrayPtr< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
sizeThe number of bytes in the specified array.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [5/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::Details::ArrayView< uint8_t >  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
sizeThe number of bytes in the specified array.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [6/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::SendTo ( System::Details::StackArray< uint8_t, N > &  buffer,
int32_t  size,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)
inline

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
sizeThe number of bytes in the specified array.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [7/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::ArrayPtr< uint8_t >  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [8/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::Details::ArrayView< uint8_t >  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [9/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::SendTo ( System::Details::StackArray< uint8_t, N > &  buffer,
SocketFlags  socketFlags,
System::SharedPtr< EndPoint remoteEP 
)
inline

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
socketFlagsThe send behavior.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [10/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::ArrayPtr< uint8_t >  buffer,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [11/12]

ASPOSECPP_SHARED_API int32_t System::Net::Sockets::Socket::SendTo ( System::Details::ArrayView< uint8_t >  buffer,
System::SharedPtr< EndPoint remoteEP 
)

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ SendTo() [12/12]

template<std::size_t N>
int32_t System::Net::Sockets::Socket::SendTo ( System::Details::StackArray< uint8_t, N > &  buffer,
System::SharedPtr< EndPoint remoteEP 
)
inline

Sends the specified data to the specified endpoint.

Parameters
bufferThe data to send.
remoteEPThe remote endpoint.
Returns
The number of sent bytes.

◆ set_Blocking()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_Blocking ( bool  value)

Sets a value that indicates if the socket is in the blocking mode.

Parameters
valueThe value that must be set.

◆ set_ConnectionTimeout()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_ConnectionTimeout ( int32_t  value)

Sets the connection timeout.

Parameters
valueThe value that must be set.

◆ set_DontFragment()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_DontFragment ( bool  value)

Sets a value that indicates if the socket allows IP datagrams to be fragmented.

Parameters
valueThe value that must be set.

◆ set_DualMode()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_DualMode ( bool  value)

Sets a value indicates if the socket is in the dual-mode.

Parameters
valueThe value that must be set.

◆ set_EnableBroadcast()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_EnableBroadcast ( bool  value)

Sets a value that indicates if the socket allows broadcast packets.

Parameters
valueThe value that must be set.

◆ set_ExclusiveAddressUse()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_ExclusiveAddressUse ( bool  value)

Sets a value that indicates if only one process can bind the socket to a port.

Parameters
valueThe value that must be set.

◆ set_LingerState()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_LingerState ( System::SharedPtr< LingerOption value)

Sets a value that indicates if the socket will delay closing in an attempt to send all pending data.

Parameters
valueThe value that must be set.

◆ set_MulticastLoopback()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_MulticastLoopback ( bool  value)

Sets a value that indicates if the socket receives outgoing multicast packets.

Parameters
valueThe value that must be set.

◆ set_NoDelay()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_NoDelay ( bool  value)

Sets a value that indicates if the socket is using the Nagle algorithm.

Parameters
valueThe value that must be set.

◆ set_ReceiveBufferSize()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_ReceiveBufferSize ( int32_t  value)

Sets the receive buffer size.

Parameters
valueThe value that must be set.

◆ set_ReceiveTimeout()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_ReceiveTimeout ( int32_t  value)

Sets a period after which a 'Receive' call will time out.

Parameters
valueThe value that must be set.

◆ set_SendBufferSize()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_SendBufferSize ( int32_t  value)

Sets the send buffer size.

Parameters
valueThe value that must be set.

◆ set_SendTimeout()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_SendTimeout ( int32_t  value)

Sets a period after which a 'Send' call will time out.

Parameters
valueThe value that must be set.

◆ set_Ttl()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::set_Ttl ( int16_t  value)

Sets the TTL value.

Parameters
valueThe value that must be set.

◆ SetSocketOption() [1/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::SetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
int32_t  optionValue 
)

Sets the specified socket option to the specified value.

Parameters
optionLevelThe socket option level.
optionNameThe name of the option that must be updated.
optionValueThe value that must be set to the specified option.

◆ SetSocketOption() [2/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::SetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
System::ArrayPtr< uint8_t >  optionValue 
)

Sets the specified socket option to the specified value.

Parameters
optionLevelThe socket option level.
optionNameThe name of the option that must be updated.
optionValueThe value that must be set to the specified option.

◆ SetSocketOption() [3/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::SetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
bool  optionValue 
)

Sets the specified socket option to the specified value.

Parameters
optionLevelThe socket option level.
optionNameThe name of the option that must be updated.
optionValueThe value that must be set to the specified option.

◆ SetSocketOption() [4/4]

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::SetSocketOption ( SocketOptionLevel  optionLevel,
SocketOptionName  optionName,
System::SharedPtr< Object optionValue 
)

Sets the specified socket option to the specified value.

Parameters
optionLevelThe socket option level.
optionNameThe name of the option that must be updated.
optionValueThe value that must be set to the specified option.

◆ Shutdown()

ASPOSECPP_SHARED_API void System::Net::Sockets::Socket::Shutdown ( SocketShutdown  how)

Disables the send and receive operations of the socket.

Parameters
howSpecifies the operation that will no longer be allowed.