1 /***********************************************************************************************************************************
2 Socket Client
3 
4 A simple socket client intended to allow access to services that are exposed via a socket.
5 ***********************************************************************************************************************************/
6 #ifndef COMMON_IO_SOCKET_CLIENT_H
7 #define COMMON_IO_SOCKET_CLIENT_H
8 
9 #include "common/io/client.h"
10 #include "common/time.h"
11 
12 /***********************************************************************************************************************************
13 Io client type
14 ***********************************************************************************************************************************/
15 #define IO_CLIENT_SOCKET_TYPE                                       STRID5("socket", 0x28558df30)
16 
17 /***********************************************************************************************************************************
18 Statistics constants
19 ***********************************************************************************************************************************/
20 #define SOCKET_STAT_CLIENT                                          "socket.client"         // Clients created
21     STRING_DECLARE(SOCKET_STAT_CLIENT_STR);
22 #define SOCKET_STAT_RETRY                                           "socket.retry"          // Connection retries
23     STRING_DECLARE(SOCKET_STAT_RETRY_STR);
24 #define SOCKET_STAT_SESSION                                         "socket.session"        // Sessions created
25     STRING_DECLARE(SOCKET_STAT_SESSION_STR);
26 
27 /***********************************************************************************************************************************
28 Constructors
29 ***********************************************************************************************************************************/
30 IoClient *sckClientNew(const String *host, unsigned int port, TimeMSec timeout);
31 
32 #endif
33