AWS SDK for C++AWS SDK for C++ Version 1.11.792 |
#include <SimpleUDP.h>
SimpleUDP definition.
Definition at line 22 of file SimpleUDP.h.
UDP_BUFFER_SIZE,
UDP_BUFFER_SIZE,
true
Constructor of SimpleUDP.
| addressFamily,AF_INET | for IPV4 or AF_INET6 for IPV6 |
| sendBufSize,if | nonzero, try set socket's send buffer size to this value. |
| receiveBufSize,if | nonzero, try set socket's receive buffer size to this value. |
| nonBlocking,if | it is true, implementation will try to create a non-blocking underlying UDP socket. Implementation should create and set the underlying udp socket. |
true,
UDP_BUFFER_SIZE,
UDP_BUFFER_SIZE,
true
An easy constructor of an IPV4 or IPV6 SimpleUDP.
| addressFamily,either | AF_INET for IPV4 or AF_INET6 for IPV6 |
| sendBufSize,if | nonzero, try set socket's send buffer size to this value. |
| receiveBufSize,if | nonzero, try set socket's receive buffer size to this value. |
| nonBlocking,if | it is true, implementation will try to create a non-blocking underlying UDP socket. Implementation should create and set the underlying udp socket. |
UDP_BUFFER_SIZE,
UDP_BUFFER_SIZE,
true
An easy constructor of SimpleUDP based on host and port.
| host,the | host that packets will be sent to, could be ipv4 or ipv6 address, or a hostname Note that "localhost" is not necessarily bind to 127.0.0.1, it could bind to ipv6 address ::1, or other type of ip addresses. If you pass localhost here, we will go through getaddrinfo procedure on Linux and Windows. |
| port,the | port number that the host listens on. |
| sendBufSize,if | nonzero, try set socket's send buffer size to this value. |
| receiveBufSize,if | nonzero, try set socket's receive buffer size to this value. |
| nonBlocking,if | it is true, implementation will try to create a non-blocking underlying UDP socket. Implementation should create and set the underlying udp socket. |
Bind underlying udp socket to an address.
| address,the | server's address info. |
| addressLength,length | of address, structure of address can vary. |
An easy way to bind to localhost.
Connect underlying udp socket to server specified in address.
| address,the | server's address info. |
| addressLength,length | of address, structure of address can vary. |
An easy way to connect to host.
| hostIP,a | valid ipv4 or ipv6 address. The address type should match the m_addressFamily type settled during construction. Otherwise the connection will fail. |
| port,the | port that host listens on. |
An easy way to connect to 127.0.0.1 or ::1 based on m_addressFamily.
Gets the AddressFamily used for the underlying socket. E.g. AF_INET, AF_INET6 etc.
Definition at line 144 of file SimpleUDP.h.
Is the underlying socket connected with a remote address
Definition at line 149 of file SimpleUDP.h.
Receive data from unique address specified in ConnectWithServer call. this function is equivalent to call ReceiveDataFrom(nullptr, 0, data, dataLen, flags).
| buffer,the | memory address where you want to store received data. |
| bufferLen,the | size of data buffer. |
Receive data from network.
| address,if | not null and underlying implementation supply the incoming data's source address, this will be filled with source address info. |
| addressLength,the | size of source address, should not be null. |
| buffer,the | memory address where you want to store received data. |
| bufferLen,the | size of data buffer. |
Send data to server without specifying address, only usable if hostIP and port are available.
| data,the | data you want to send. |
| dataLen,the | length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior |
Send data to server.
| address,the | server's address info. |
| addressLength,length | of address, structure of address can vary. |
| data,the | memory address of the data you want to send. |
| dataLen,the | length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior |
An easy way to send data to localhost, when the underlying udp is connected, call this function will send the data to where it connects to, not essentially to localhost. when it's not connected, it will send data to localhost, but this call will not connect underlying socket to localhost for you.
| data,the | memory address of the data you want to send. |
| dataLen,the | length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior |
| port,port | of localhost. |