Skip to content
Pradeep Barthur edited this page Aug 21, 2014 · 6 revisions

Zero Socket

Zero Socket is a minimalistic socket interceptor. It can be easily integrated into resource-limited or embedded projects.

You can find more information about Zero Socket format at xaptum.com

Library sources are available at github.com/xaptum/zerosocket

Philosophy

Most client side libraries are meant to add a protocol layer. However the socket and network layer needs to be managed independent of the

Features

  • compatible with C++99 or later
  • standard dependencies (even libc , libc++)
  • highly portable (tested on x86/amd64, ARM)
  • extremely small code footprint
  • compile time control through -D options
  • no dynamic memory allocation
  • library code is covered with unit-tests

Design

Install

To clone the repository you should have git client installed. Just run:

$ git clone https://github.com/xaptum/zerosocket.git

API

Global variables & macros

enum ZSElement getZSElementIndex(const char * name) ;

const char * getZSVersion(void);

int zsocket (int family, int type, int protocol);

int zconnect(int sockfd, struct sockaddr *serv_addr, int addrlen);

int zbind(int sockfd, struct sockaddr *my_addr,int addrlen);

int zlisten(int sockfd,int backlog);

int zaccept (int sockfd, struct sockaddr *cliaddr, socklen_t *addrlen);

int zsend(int sockfd, const void *msg, int len, int flags);

int zrecv(int sockfd, void *buf, size_t len, int flags);

int zsendto(int sockfd, const void *msg, int len, int flags, const struct sockaddr *to, socklen_t tolen);

int zrecvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);

int zclose( int sockfd );

Other info

This software is distributed under GPLv2 license, so feel free to integrate it in your commercial products.

Thanks to Serge Zaitsev for jsmn library (http://zserge.bitbucket.org/jsmn.html). I've included the source as is, but would be publishing enhancements in the near future.

This repository will be ready for use by Aug 20, 2014

Clone this wiki locally