socket.h File Reference
`#include "lscp/thread.h"`
`#include <unistd.h>`
`#include <sys/socket.h>`
`#include <netinet/in.h>`
`#include <netinet/tcp.h>`
`#include <arpa/inet.h>`
`#include <netdb.h>`

Go to the source code of this file.

## Data Structures

struct | _lscp_socket_agent_t

## Macros

#define | INVALID_SOCKET -1
#define | SOCKET_ERROR -1
#define | closesocket(s)
#define | LSCP_BUFSIZ 1024

## Typedefs

typedef int | lscp_socket_t
typedef struct _lscp_socket_agent_t | lscp_socket_agent_t

## Functions

void | lscp_socket_perror (const char *pszPrefix)
void | lscp_socket_herror (const char *pszPrefix)
void | lscp_socket_getopts (const char *pszPrefix, lscp_socket_t sock)
void | lscp_socket_trace (const char *pszPrefix, struct sockaddr_in *pAddr, const char *pchBuffer, int cchBuffer)
void | lscp_socket_agent_init (lscp_socket_agent_t *pAgent, lscp_socket_t sock, struct sockaddr_in *pAddr, int cAddr)
lscp_status_t | lscp_socket_agent_start (lscp_socket_agent_t *pAgent, lscp_thread_proc_t pfnProc, void *pvData, int iDetach)
lscp_status_t | lscp_socket_agent_join (lscp_socket_agent_t *pAgent)
lscp_status_t | lscp_socket_agent_free (lscp_socket_agent_t *pAgent)

## Macro Definition Documentation

## closesocket

#define closesocket | ( |  | s | ) |

Value:
close(s)

Referenced by lscp_client_create(), and lscp_socket_agent_free().

## INVALID_SOCKET

#define INVALID_SOCKET -1

Referenced by lscp_client_create(), and lscp_socket_agent_free().

## LSCP_BUFSIZ

#define LSCP_BUFSIZ 1024

Referenced by lscp_add_midi_instrument_map(), lscp_clear_midi_instruments(), lscp_create_audio_device(), lscp_create_fxsend(), lscp_create_midi_device(), lscp_destroy_audio_device(), lscp_destroy_fxsend(), lscp_destroy_midi_device(), lscp_edit_channel_instrument(), lscp_get_audio_channel_info(), lscp_get_audio_channel_param_info(), lscp_get_audio_device_info(), lscp_get_audio_driver_info(), lscp_get_audio_driver_param_info(), lscp_get_channel_buffer_fill(), lscp_get_channel_info(), lscp_get_channel_stream_count(), lscp_get_channel_stream_usage(), lscp_get_channel_voice_count(), lscp_get_engine_info(), lscp_get_fxsend_info(), lscp_get_fxsends(), lscp_get_midi_device_info(), lscp_get_midi_driver_info(), lscp_get_midi_driver_param_info(), lscp_get_midi_instrument_info(), lscp_get_midi_instrument_map_name(), lscp_get_midi_instruments(), lscp_get_midi_port_info(), lscp_get_midi_port_param_info(), lscp_list_fxsends(), lscp_list_midi_instruments(), lscp_load_engine(), lscp_load_instrument(), lscp_load_instrument_non_modal(), lscp_map_midi_instrument(), lscp_remove_channel(), lscp_remove_midi_instrument_map(), lscp_reset_channel(), lscp_set_audio_channel_param(), lscp_set_audio_device_param(), lscp_set_channel_audio_channel(), lscp_set_channel_audio_device(), lscp_set_channel_audio_type(), lscp_set_channel_midi_channel(), lscp_set_channel_midi_device(), lscp_set_channel_midi_map(), lscp_set_channel_midi_port(), lscp_set_channel_midi_type(), lscp_set_channel_mute(), lscp_set_channel_solo(), lscp_set_channel_volume(), lscp_set_fxsend_audio_channel(), lscp_set_fxsend_level(), lscp_set_fxsend_midi_controller(), lscp_set_fxsend_name(), lscp_set_midi_device_param(), lscp_set_midi_instrument_map_name(), lscp_set_midi_port_param(), lscp_set_streams(), lscp_set_voices(), lscp_set_volume(), and lscp_unmap_midi_instrument().

## SOCKET_ERROR

#define SOCKET_ERROR -1

Referenced by lscp_client_create().

## Typedef Documentation

## lscp_socket_agent_t

typedef struct _lscp_socket_agent_t lscp_socket_agent_t

## lscp_socket_t

typedef int lscp_socket_t

## Function Documentation

## lscp_socket_agent_free()

lscp_status_t lscp_socket_agent_free | ( | lscp_socket_agent_t * | pAgent | ) |

References closesocket, INVALID_SOCKET, _lscp_socket_agent_t::iState, LSCP_FAILED, lscp_thread_destroy(), _lscp_socket_agent_t::pThread, and _lscp_socket_agent_t::sock.

Referenced by lscp_client_destroy(), and lscp_client_unsubscribe().

## lscp_socket_agent_init()

void lscp_socket_agent_init | ( | lscp_socket_agent_t * | pAgent,
|  | lscp_socket_t | sock,
|  | struct sockaddr_in * | pAddr,
|  | int | cAddr )

References _lscp_socket_agent_t::addr, _lscp_socket_agent_t::iState, _lscp_socket_agent_t::pThread, and _lscp_socket_agent_t::sock.

Referenced by lscp_client_create().

## lscp_socket_agent_join()

lscp_status_t lscp_socket_agent_join | ( | lscp_socket_agent_t * | pAgent | ) |

References LSCP_FAILED, lscp_thread_join(), and _lscp_socket_agent_t::pThread.

Referenced by lscp_client_join().

## lscp_socket_agent_start()

lscp_status_t lscp_socket_agent_start | ( | lscp_socket_agent_t * | pAgent,
|  | lscp_thread_proc_t | pfnProc,
|  | void * | pvData,
|  | int | iDetach )

References _lscp_socket_agent_t::iState, LSCP_FAILED, LSCP_OK, lscp_thread_create(), lscp_thread_destroy(), and _lscp_socket_agent_t::pThread.

## lscp_socket_getopts()

void lscp_socket_getopts | ( | const char * | pszPrefix,
|  | lscp_socket_t | sock )

Referenced by lscp_client_create().

## lscp_socket_herror()

void lscp_socket_herror | ( | const char * | pszPrefix | ) |

Referenced by lscp_client_create().

## lscp_socket_perror()

void lscp_socket_perror | ( | const char * | pszPrefix | ) |

Referenced by lscp_client_create().

## lscp_socket_trace()

void lscp_socket_trace | ( | const char * | pszPrefix,
|  | struct sockaddr_in * | pAddr,
|  | const char * | pchBuffer,
|  | int | cchBuffer )