NETIO is a simple cross-platform API for accessing UDP and TCP sockets.
More...
Go to the source code of this file.
|
typedef struct losSocket_T * | losSocket |
| this is the Library object that is used to read and write network data to and from the Native Socket as the user only holds a pointer to the library object that is controlled by the library. More...
|
|
typedef enum losSocketBit | losSocketBit |
| losSocketBit is used for socket object flags
|
|
typedef struct losCreateSocketInfo | losCreateSocketInfo |
| losCreateSocketInfo is the socket creation struct we pass this into the creation function for the library to create a socket object
|
|
typedef struct losUdpData | losUdpData |
| simple wrapper used to handle UDP data on the server side
|
|
|
EXPORT_DLL uint32_t * | losNetworkBytesToSystemBytes (_in_ const uint32_t *bytes, _in_ const size_t bytes_size) |
| losNetworkBytesToSystemBytes converts from big-endian to little-endian(for now as we have not got an arm platform to work with) More...
|
|
EXPORT_DLL uint32_t * | losSystemBytesToNetworkBytes (_in_ const uint32_t *bytes, _in_ const size_t bytes_size) |
| losSystemBytesToNetworkBytes converts from little-endian to big-endian(for now as we have not got an arm platform to work with) More...
|
|
EXPORT_DLL int32_t * | losNetworkBytesToSystemBytesSigned (_in_ const int32_t *bytes, _in_ const size_t bytes_size) |
| losNetworkBytesToSystemBytesSigned converts signed from big-endian to little-endian(for now as we have not got an arm platform to work with) More...
|
|
EXPORT_DLL int32_t * | losSystemBytesToNetworkBytesSigned (_in_ const int32_t *bytes, _in_ const size_t bytes_size) |
| losSystemBytesToNetworkBytesSigned converts signed from little-endian to big-endian(for now as we have not got an arm platform to work with) More...
|
|
EXPORT_DLL losResult | losCreateSocket (_out_ losSocket *handle, _in_ const losCreateSocketInfo &socket_info) |
| losCreateSocket is to create the library object but dose not release the object to the library user More...
|
|
EXPORT_DLL losResult | losReadSocket (_in_ const losSocket handle, _out_ void *buffer, _in_ const size_t bytes_to_read) |
| losReadSocket read data from native socket held by the library object (NOTE: for server side udp it is required to use a losUdpData struct to wrap the buffer to receive data correctly) More...
|
|
EXPORT_DLL losResult | losWaitForClient (_in_ const losSocket handle, _out_ losSocket *new_client) |
| losWaitForClient is for server side TCP connection only we use this to wait for client connections and return a library object of the connected client More...
|
|
EXPORT_DLL losResult | losWriteSocket (_in_ const losSocket handle, _in_ const void *buffer, _in_ const size_t buffer_size) |
| losWriteSocket write data to native socket held by the library object (NOTE: for server side udp it is required to use a losUdpData struct to wrap the buffer to send data correctly) More...
|
|
EXPORT_DLL losResult | losDestroySocket (_in_ losSocket handle) |
| losDestroySocket is to close the library object and safely delete it More...
|
|
NETIO is a simple cross-platform API for accessing UDP and TCP sockets.
- Author
- Luke Shore luket.nosp@m.hemo.nosp@m.dded@.nosp@m.gmai.nosp@m.l.com
- Version
- 1.0
- Date
- 05/12/2022
◆ losSocket
this is the Library object that is used to read and write network data to and from the Native Socket as the user only holds a pointer to the library object that is controlled by the library.
Importation of libraries
◆ losSocketBit
losSocketBit is used for socket object flags
Enumerator |
---|
LOS_SOCKET_UDP | set socket to UDP socket flag bit
|
LOS_SOCKET_TCP | set socket to TCP socket flag bit
|
LOS_SOCKET_APF | this is for automatically port forwarding in the router flag bit (NOT_IMPLEMENTED)
|
LOS_SOCKET_SERVER | this is to tell the library that the socket is to be used as a server
|
◆ losCreateSocket()
losCreateSocket is to create the library object but dose not release the object to the library user
- Parameters
-
[out] | handle | |
[in] | socket_info | |
- Returns
- losResult
◆ losDestroySocket()
losDestroySocket is to close the library object and safely delete it
- Parameters
-
- Returns
- losResult
◆ losNetworkBytesToSystemBytes()
EXPORT_DLL uint32_t* losNetworkBytesToSystemBytes |
( |
_in_ const uint32_t * |
bytes, |
|
|
_in_ const size_t |
bytes_size |
|
) |
| |
losNetworkBytesToSystemBytes converts from big-endian to little-endian(for now as we have not got an arm platform to work with)
- Parameters
-
[out] | bytes | |
[in] | bytes_size | |
- Returns
- losResult
◆ losNetworkBytesToSystemBytesSigned()
EXPORT_DLL int32_t* losNetworkBytesToSystemBytesSigned |
( |
_in_ const int32_t * |
bytes, |
|
|
_in_ const size_t |
bytes_size |
|
) |
| |
losNetworkBytesToSystemBytesSigned converts signed from big-endian to little-endian(for now as we have not got an arm platform to work with)
- Parameters
-
[out] | bytes | |
[in] | bytes_size | |
- Returns
- losResult
◆ losReadSocket()
losReadSocket read data from native socket held by the library object (NOTE: for server side udp it is required to use a losUdpData struct to wrap the buffer to receive data correctly)
- Parameters
-
[in] | handle | |
[out] | buffer | |
[in] | bytes_to_read | |
- Returns
- losResult
◆ losSystemBytesToNetworkBytes()
EXPORT_DLL uint32_t* losSystemBytesToNetworkBytes |
( |
_in_ const uint32_t * |
bytes, |
|
|
_in_ const size_t |
bytes_size |
|
) |
| |
losSystemBytesToNetworkBytes converts from little-endian to big-endian(for now as we have not got an arm platform to work with)
- Parameters
-
[out] | bytes | |
[in] | bytes_size | |
- Returns
- losResult
◆ losSystemBytesToNetworkBytesSigned()
EXPORT_DLL int32_t* losSystemBytesToNetworkBytesSigned |
( |
_in_ const int32_t * |
bytes, |
|
|
_in_ const size_t |
bytes_size |
|
) |
| |
losSystemBytesToNetworkBytesSigned converts signed from little-endian to big-endian(for now as we have not got an arm platform to work with)
- Parameters
-
[out] | bytes | |
[in] | bytes_size | |
- Returns
- losResult
◆ losWaitForClient()
losWaitForClient is for server side TCP connection only we use this to wait for client connections and return a library object of the connected client
- Parameters
-
[in] | handle | |
[out] | new_client | |
- Returns
- losResult
◆ losWriteSocket()
losWriteSocket write data to native socket held by the library object (NOTE: for server side udp it is required to use a losUdpData struct to wrap the buffer to send data correctly)
- Parameters
-
[in] | handle | |
[in] | buffer | |
[in] | buffer_size | |
- Returns
- losResult