|
B2BITS FIX Antenna HFT
1.0.17
|
#include <stdio.h>#include "b2b_platform.h"#include "sockets_session.h"#include "sockets_logging.h"
Include dependency graph for sockets_iface.h:Classes | |
| struct | Server |
| struct | Socket |
| struct | SocketEvents |
| struct | SocketMethods |
| struct | Sockets |
| struct | SocketThread |
Macros | |
| #define | CONNECT_TIMEOUT_MS (10 * 1000) |
| #define | MAX_LISTENING_SOCKETS 128 |
| #define | MAX_RUNTIME_SOCKETS_ON_SERVER 32 |
| #define | MS_BETWEEN_LOGCLIENT_TIMESLICES 500 |
| #define | MS_BETWEEN_RECONNECTS 3000 |
| #define | NANOSEC_IN_MS 1000000LL |
| #define | SOCKET_RECV_BUF_SIZE 65536 |
| #define | SOCKET_THREAD_TIME_ACCESS_THROTTLE 10 |
Typedefs | |
| typedef struct Socket | Socket |
| typedef void(* | SOCKET_ctor )(struct Socket *sock, struct Server *srv, int fd, int isListening, enum SocketID socketID, void *data) |
| typedef void(* | SOCKET_dtor )(struct Socket *sock) |
| typedef int(* | SOCKET_event_before_new_data_received )(struct Socket *sock) |
| typedef void(* | SOCKET_event_can_write_nonblock )(struct Socket *sock) |
| typedef void(* | SOCKET_event_disconnected )(struct Socket *sock) |
| typedef void(* | SOCKET_event_incoming_connection_accepted )(struct Socket *sock) |
| typedef void(* | SOCKET_event_new_data_received )(struct Socket *sock, char *buf, int len) |
| typedef void(* | SOCKET_event_new_data_received_appended )(struct Socket *sock, char *buf, int startPos, int len) |
| typedef void(* | SOCKET_event_outgoing_connected )(struct Socket *sock) |
| typedef void(* | SOCKET_event_socket_closed )(struct Socket *sock) |
| typedef void(* | SOCKET_event_socket_created )(struct Socket *sock) |
| typedef int(* | SOCKET_getAddrAny )(int port, struct sockaddr_in *sin) |
| typedef int(* | SOCKET_getAddrByName )(const char *hostAddr, int port, struct sockaddr_in *sin) |
| typedef int(* | SOCKET_initSocketOptions )(struct Server *srv, int fd) |
| typedef int(* | SOCKET_isConnected )(int fd) |
| typedef int(* | SOCKET_recv_zero_copy )(struct Socket *sock, char **buf) |
| typedef int(* | SOCKET_setNonblocking )(int fd) |
| typedef int(* | SOCKET_setRecvBufferSize )(int fd, int size) |
| typedef int(* | SOCKET_setSendBufferSize )(int fd, int size) |
| typedef int(* | SOCKET_socket )(struct Server *srv, enum SocketID localSocketID) |
| typedef void(* | SOCKET_socket_write_lock )(struct Socket *sock, int doLock) |
Functions | |
| void | _initLoggerClient (struct SocketThread *thread) |
| void | _initLoggerClient2 (struct SocketThread *thread, enum ServerID serverID, enum SocketID logSocketID) |
| struct Socket * | add_socket (struct Server *srv, struct SocketMethods *type, int fd, int isListening, enum SocketID socketID, int connecting, void *socket_data) |
| void | addListeningSocket (struct Server *srv, enum SocketID socketID) |
| struct Server * | addServerToThread (struct SocketThread *thread, struct NetworkDeclaration *netDecl, enum ServerID serverID, struct SocketEvents *eventMethods) |
| int | getListenSocket (enum SocketID socketID, struct Server *hostingServer, struct Socket **returnSocket) |
| int | getServerDecl (enum ServerID serverID, struct NetworkDeclaration *net, struct ServerDeclaration **decl) |
| struct Server * | getServerFromThread (struct SocketThread *thread, enum ServerID id) |
| int | getSocket (enum SocketID socketID, struct Server *hostingServer, struct Socket **returnSocket) |
| int | getSocketDecl (enum SocketID socketID, struct NetworkDeclaration *net, struct SocketDeclaration **decl) |
| void | remove_socket (struct Sockets *socks, int sock) |
| int | socket_alloc_recvbuf (struct Socket *sock, int len) |
| static int | socket_can_write (struct Socket *sock) |
| void | socket_close (struct Socket *sock) |
| struct Socket * | socket_connect (struct Server *srv, const char *address, int port, enum SocketID localSocketID, void *socket_data) |
| struct Socket * | socket_connect_blocking (struct Server *srv, const char *address, int port, enum SocketID localSocketID, void *socket_data) |
| struct Socket * | socket_connect_to_def_destination (struct Server *srv, enum SocketID localSocketID, void *socket_data) |
| struct Socket * | socket_connect_to_def_destination_blocking (struct Server *srv, enum SocketID localSocketID, void *socket_data) |
| struct Socket * | socket_connect_to_socket (struct Server *srv, enum SocketID localSocketID, struct NetworkDeclaration *remoteNet, enum SocketID remoteSocket, void *socket_data) |
| void | socket_construct (struct Socket *newsock, struct Server *srv, struct SocketMethods *type, int fd, int isListening, enum SocketID socketID, void *socket_data) |
| void | socket_ctor_def (struct Socket *sock, struct Server *srv, int fd, int isListening, enum SocketID socketID, void *data) |
| void | socket_dtor_def (struct Socket *sock) |
| void | socket_free_rcvbuf (struct Socket *sock) |
| static int | socket_is_connected (struct Socket *sock) |
| int | socket_realloc_recvbuf (struct Socket *sock, int len) |
| int | socket_send (struct Socket *sock, const char *buf, int len) |
| int | socket_send_blocking (struct Socket *sock, const char *buf, int len) |
| int | socket_send_if_connected (struct Socket *sock, const char *buf, int len) |
| static void | socket_set_recv_pos (struct Socket *sock, int pos) |
| void | thread_construct (struct SocketThread *thread) |
| void | thread_construct2 (struct SocketThread *thread, int createLogSocket) |
| int | thread_init_listen_daemon (struct SocketThread *thread) |
| int | thread_job_timeslice (struct SocketThread *thread) |
Variables | |
| struct SocketMethods | FIFOSocketMethods |
| struct SocketMethods | TCPSocketMethods |
| #define CONNECT_TIMEOUT_MS (10 * 1000) |
| #define MAX_LISTENING_SOCKETS 128 |
| #define MAX_RUNTIME_SOCKETS_ON_SERVER 32 |
| #define MS_BETWEEN_LOGCLIENT_TIMESLICES 500 |
| #define MS_BETWEEN_RECONNECTS 3000 |
| #define NANOSEC_IN_MS 1000000LL |
| #define SOCKET_RECV_BUF_SIZE 65536 |
| #define SOCKET_THREAD_TIME_ACCESS_THROTTLE 10 |
| typedef void(* SOCKET_ctor)(struct Socket *sock, struct Server *srv, int fd, int isListening, enum SocketID socketID, void *data) |
| typedef void(* SOCKET_dtor)(struct Socket *sock) |
| typedef int(* SOCKET_event_before_new_data_received)(struct Socket *sock) |
| typedef void(* SOCKET_event_can_write_nonblock)(struct Socket *sock) |
| typedef void(* SOCKET_event_disconnected)(struct Socket *sock) |
| typedef void(* SOCKET_event_incoming_connection_accepted)(struct Socket *sock) |
| typedef void(* SOCKET_event_new_data_received)(struct Socket *sock, char *buf, int len) |
| typedef void(* SOCKET_event_new_data_received_appended)(struct Socket *sock, char *buf, int startPos, int len) |
| typedef void(* SOCKET_event_outgoing_connected)(struct Socket *sock) |
| typedef void(* SOCKET_event_socket_closed)(struct Socket *sock) |
| typedef void(* SOCKET_event_socket_created)(struct Socket *sock) |
| typedef int(* SOCKET_getAddrAny)(int port, struct sockaddr_in *sin) |
| typedef int(* SOCKET_getAddrByName)(const char *hostAddr, int port, struct sockaddr_in *sin) |
| typedef int(* SOCKET_initSocketOptions)(struct Server *srv, int fd) |
| typedef int(* SOCKET_isConnected)(int fd) |
| typedef int(* SOCKET_recv_zero_copy)(struct Socket *sock, char **buf) |
| typedef int(* SOCKET_setNonblocking)(int fd) |
| typedef int(* SOCKET_setRecvBufferSize)(int fd, int size) |
| typedef int(* SOCKET_setSendBufferSize)(int fd, int size) |
| typedef void(* SOCKET_socket_write_lock)(struct Socket *sock, int doLock) |
| void _initLoggerClient | ( | struct SocketThread * | thread | ) |
| void _initLoggerClient2 | ( | struct SocketThread * | thread, |
| enum ServerID | serverID, | ||
| enum SocketID | logSocketID | ||
| ) |
| struct Socket* add_socket | ( | struct Server * | srv, |
| struct SocketMethods * | type, | ||
| int | fd, | ||
| int | isListening, | ||
| enum SocketID | socketID, | ||
| int | connecting, | ||
| void * | socket_data | ||
| ) |
| struct Server* addServerToThread | ( | struct SocketThread * | thread, |
| struct NetworkDeclaration * | netDecl, | ||
| enum ServerID | serverID, | ||
| struct SocketEvents * | eventMethods | ||
| ) |
| int getListenSocket | ( | enum SocketID | socketID, |
| struct Server * | hostingServer, | ||
| struct Socket ** | returnSocket | ||
| ) |
| int getServerDecl | ( | enum ServerID | serverID, |
| struct NetworkDeclaration * | net, | ||
| struct ServerDeclaration ** | decl | ||
| ) |
| struct Server* getServerFromThread | ( | struct SocketThread * | thread, |
| enum ServerID | id | ||
| ) |
| int getSocket | ( | enum SocketID | socketID, |
| struct Server * | hostingServer, | ||
| struct Socket ** | returnSocket | ||
| ) |
| int getSocketDecl | ( | enum SocketID | socketID, |
| struct NetworkDeclaration * | net, | ||
| struct SocketDeclaration ** | decl | ||
| ) |
| void remove_socket | ( | struct Sockets * | socks, |
| int | sock | ||
| ) |
| int socket_alloc_recvbuf | ( | struct Socket * | sock, |
| int | len | ||
| ) |
|
inlinestatic |
References Socket::canWrite, and Socket::connecting.
| void socket_close | ( | struct Socket * | sock | ) |
| struct Socket* socket_connect | ( | struct Server * | srv, |
| const char * | address, | ||
| int | port, | ||
| enum SocketID | localSocketID, | ||
| void * | socket_data | ||
| ) |
| struct Socket* socket_connect_blocking | ( | struct Server * | srv, |
| const char * | address, | ||
| int | port, | ||
| enum SocketID | localSocketID, | ||
| void * | socket_data | ||
| ) |
| struct Socket* socket_connect_to_def_destination | ( | struct Server * | srv, |
| enum SocketID | localSocketID, | ||
| void * | socket_data | ||
| ) |
| struct Socket* socket_connect_to_def_destination_blocking | ( | struct Server * | srv, |
| enum SocketID | localSocketID, | ||
| void * | socket_data | ||
| ) |
| struct Socket* socket_connect_to_socket | ( | struct Server * | srv, |
| enum SocketID | localSocketID, | ||
| struct NetworkDeclaration * | remoteNet, | ||
| enum SocketID | remoteSocket, | ||
| void * | socket_data | ||
| ) |
| void socket_construct | ( | struct Socket * | newsock, |
| struct Server * | srv, | ||
| struct SocketMethods * | type, | ||
| int | fd, | ||
| int | isListening, | ||
| enum SocketID | socketID, | ||
| void * | socket_data | ||
| ) |
| void socket_ctor_def | ( | struct Socket * | sock, |
| struct Server * | srv, | ||
| int | fd, | ||
| int | isListening, | ||
| enum SocketID | socketID, | ||
| void * | data | ||
| ) |
| void socket_dtor_def | ( | struct Socket * | sock | ) |
| void socket_free_rcvbuf | ( | struct Socket * | sock | ) |
|
inlinestatic |
References Socket::connecting.
| int socket_realloc_recvbuf | ( | struct Socket * | sock, |
| int | len | ||
| ) |
| int socket_send | ( | struct Socket * | sock, |
| const char * | buf, | ||
| int | len | ||
| ) |
| int socket_send_blocking | ( | struct Socket * | sock, |
| const char * | buf, | ||
| int | len | ||
| ) |
| int socket_send_if_connected | ( | struct Socket * | sock, |
| const char * | buf, | ||
| int | len | ||
| ) |
|
inlinestatic |
References Socket::recvPos.
| void thread_construct | ( | struct SocketThread * | thread | ) |
| void thread_construct2 | ( | struct SocketThread * | thread, |
| int | createLogSocket | ||
| ) |
| int thread_init_listen_daemon | ( | struct SocketThread * | thread | ) |
| int thread_job_timeslice | ( | struct SocketThread * | thread | ) |
| struct SocketMethods FIFOSocketMethods |
| struct SocketMethods TCPSocketMethods |
1.8.5