4#include <system/shared_ptr.h>
5#include <system/idisposable.h>
7#include <net/sockets/socket.h>
8#include <net/sockets/network_stream.h>
9#include <net/ip_end_point.h>
27 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
29 ASPOSECPP_SHARED_RTTI_INFO_DECL();
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Represents a client for the TCP network services. Objects of this class should only be allocated usin...
Definition: tcp_client.h:20
TcpClient(String hostname, int32_t port)
Constructs a new instance.
System::SharedPtr< LingerOption > get_LingerState()
Gets a value that indicates if the socket will delay closing in an attempt to send all pending data.
void set_ExclusiveAddressUse(bool value)
Sets a value that indicates if the current instance allows only one client to use a port.
TcpClient(AddressFamily family)
Constructs a new instance.
int32_t get_ReceiveBufferSize()
Gets the size of the buffer that is used for receiving data.
int32_t get_ReceiveTimeout()
Gets a value that indicates an amount of time after which data receiving will time out.
System::SharedPtr< IAsyncResult > BeginConnect(String host, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
Initiates an asynchronous connect operation.
int32_t get_Available()
Returns the number of bytes that are received and ready to read.
int32_t get_SendBufferSize()
Gets the size of the buffer that is used for sending data.
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.
void Connect(String hostname, int32_t port)
Establishes a connection to the specified remote host.
void Connect(System::ArrayPtr< System::SharedPtr< IPAddress > > ipAddresses, int32_t port)
Establishes a connection to the specified remote host.
System::SharedPtr< IAsyncResult > BeginConnect(System::ArrayPtr< System::SharedPtr< IPAddress > > addresses, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
Initiates an asynchronous connect operation.
void set_SendBufferSize(int32_t value)
Sets the size of the buffer that is used for sending data.
System::SharedPtr< Socket > get_Client()
Gets the socket.
void set_ReceiveBufferSize(int32_t value)
Sets the size of the buffer that is used for receiving data.
virtual ~TcpClient()
Destructs the current instance.
TcpClient()
Constructs a new instance.
System::SharedPtr< NetworkStream > GetStream()
Returns the stream that is used for sending and receiving data.
void set_SendTimeout(int32_t value)
Sets a value that indicates an amount of time after which data sending will time out.
int32_t get_SendTimeout()
Gets a value that indicates an amount of time after which data sending will time out.
void set_NoDelay(bool value)
Sets a value that indicates if the current instance is using the Nagle algorithm.
void set_ReceiveTimeout(int32_t value)
Sets a value that indicates an amount of time after which data receiving will time out.
TcpClient(System::SharedPtr< IPEndPoint > localEP)
Constructs a new instance.
void EndConnect(System::SharedPtr< IAsyncResult > asyncResult)
Waits until the specified asynchronous connect operation completes.
void Connect(System::SharedPtr< IPEndPoint > remoteEP)
Establishes a connection to the specified remote host.
void set_Client(System::SharedPtr< Socket > value)
Sets the socket.
bool get_Connected()
Returns a value that indicates if the socket is connected to the remote host.
bool get_ExclusiveAddressUse()
Gets a value that indicates if the current instance allows only one client to use a port.
bool get_NoDelay()
Gets a value that indicates if the current instance is using the Nagle algorithm.
System::SharedPtr< IAsyncResult > BeginConnect(System::SharedPtr< IPAddress > address, int32_t port, AsyncCallback requestCallback, System::SharedPtr< Object > state)
Initiates an asynchronous connect operation.
void Connect(System::SharedPtr< IPAddress > address, int32_t port)
Establishes a connection to the specified remote host.
void Close()
Closes the connection and disposes the current instance.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
AddressFamily
Enumerates the address families.
Definition: address_family.h:12
Definition: db_command.h:9
System::MulticastDelegate< void(SharedPtr< IAsyncResult >)> AsyncCallback
A delegate type that represents a method to be called when asynchronous operation completes.
Definition: async_callback.h:13