|
ServerSocket | TcpServerSocket_create (char *address, int port) |
|
void | ServerSocket_listen (ServerSocket socket) |
|
Socket | ServerSocket_accept (ServerSocket socket) |
|
void | ServerSocket_setBacklog (ServerSocket socket, int backlog) |
|
void | ServerSocket_destroy (ServerSocket socket) |
|
Socket | TcpSocket_create () |
|
int | Socket_connect (Socket socket, char *address, int port) |
|
int | Socket_read (Socket socket, uint8_t *buf, int size) |
|
int | Socket_write (Socket socket, uint8_t *buf, int size) |
|
void | Socket_destroy (Socket socket) |
|
Thread | Thread_create (ThreadExecutionFunction function, void *parameter, bool autodestroy) |
|
void | Thread_start (Thread thread) |
|
void | Thread_destroy (Thread thread) |
|
void | Thread_sleep (int millies) |
|
uint64_t | Hal_getTimeInMs () |
|
Thread and Socket abstraction layer. This functions have to be implemented to port libIEC61850 to a new hardware/OS platform.
Opaque reference for a server socket instance
typedef struct sSocket* Socket |
Opaque reference for a client or connection socket instance
typedef struct sThread* Thread |
Opaque reference for a Thread instance
typedef void*(* ThreadExecutionFunction)(void *) |
Reference to a function that is called when starting the thread
uint64_t Hal_getTimeInMs |
( |
| ) |
|
Get the system time in milliseconds
void ServerSocket_setBacklog |
( |
ServerSocket |
socket, |
|
|
int |
backlog |
|
) |
| |
int Socket_connect |
( |
Socket |
socket, |
|
|
char * |
address, |
|
|
int |
port |
|
) |
| |
void Socket_destroy |
( |
Socket |
socket | ) |
|
int Socket_read |
( |
Socket |
socket, |
|
|
uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
int Socket_write |
( |
Socket |
socket, |
|
|
uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
ServerSocket TcpServerSocket_create |
( |
char * |
address, |
|
|
int |
port |
|
) |
| |
Create a new TcpServerSocket instance
- Parameters
-
address | ip address or hostname to listen on |
port | the TCP port to listen on |
- Returns
- the newly create TcpServerSocket instance
Create a new Thread instance
- Parameters
-
function | the entry point of the thread |
parameter | a parameter that is passed to the threads start function |
autodestroy | the thread is automatically destroyed if the ThreadExecutionFunction has finished. |
- Returns
- the newly created Thread instance
void Thread_destroy |
( |
Thread |
thread | ) |
|
Destroy a Thread and free resources.
- Parameters
-
thread | the Thread instance to destroy |
void Thread_sleep |
( |
int |
millies | ) |
|
Suspend execution of the Thread for the specified number of milliseconds
void Thread_start |
( |
Thread |
thread | ) |
|
Start a Thread.
This function invokes the start function of the thread. The thread terminates when the start function returns.
- Parameters
-
thread | the Thread instance to start |