MIP_SDK  v3.0.0-736-g212583cf
MicroStrain Communications Library for embedded systems
Functions | Variables
tcp_socket.c File Reference
#include "tcp_socket.h"
#include "microstrain/logging.h"
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netdb.h>
#include <string.h>
#include <stdio.h>

Functions

void tcp_socket_init (tcp_socket *socket_ptr)
 
bool tcp_socket_is_open (const tcp_socket *socket_ptr)
 
static bool tcp_socket_open_common (tcp_socket *socket_ptr, const char *hostname, uint16_t port, unsigned int timeout_ms)
 
bool tcp_socket_open (tcp_socket *socket_ptr, const char *hostname, uint16_t port, unsigned int timeout_ms)
 
bool tcp_socket_close (tcp_socket *socket_ptr)
 
bool tcp_socket_send (tcp_socket *socket_ptr, const void *buffer, size_t num_bytes, size_t *bytes_written)
 
bool tcp_socket_recv (tcp_socket *socket_ptr, void *buffer, size_t num_bytes, size_t *bytes_read)
 

Variables

static const int INVALID_SOCKET = -1
 
static const int SEND_FLAGS = MSG_NOSIGNAL
 

Function Documentation

◆ tcp_socket_open_common()

static bool tcp_socket_open_common ( tcp_socket socket_ptr,
const char *  hostname,
uint16_t  port,
unsigned int  timeout_ms 
)
static

Variable Documentation

◆ INVALID_SOCKET

const int INVALID_SOCKET = -1
static

◆ SEND_FLAGS

const int SEND_FLAGS = MSG_NOSIGNAL
static