libjapi  0.3.2
Universal JSON API Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
networking.h File Reference

Networking helper functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int tcp_start_server (const char *port)
 Start a new TCP server. More...
 
int tcp4_start_server (const char *port)
 Start a new TCP server using IPv4. More...
 
int tcp6_start_server (const char *port)
 Start a new TCP server using IPv6. More...
 

Detailed Description

Networking helper functions.

Author
Christopher Stender
Date
2018-02-15
Version
0.1

This module collects networking helper functions like tcp_start_server().

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

int tcp4_start_server ( const char *  port)

Start a new TCP server using IPv4.

A new TCP server is started on a user specified port using IPv4. Therefore a new socket is created and an address is bound to it.

Parameters
portPort to listen on for incoming TCP connections.
Returns
On success, a file descriptor for the new socket is returned. On error, -1 is returned and errno ist set appropriately.
int tcp6_start_server ( const char *  port)

Start a new TCP server using IPv6.

A new TCP server is started on a user specified port using IPv6. Therefore a new socket is created and an address is bound to it.

Parameters
portPort to listen on for incoming TCP connections.
Returns
On success, a file descriptor for the new socket is returned. On error, -1 is returned and errno ist set appropriately.
int tcp_start_server ( const char *  port)

Start a new TCP server.

A new TCP server is started on a user specified port. Therefore a new socket is created and an address is bound to it.

Parameters
portPort to listen on for incoming TCP connections.
Returns
On success, a file descriptor for the new socket is returned. On error, -1 is returned and errno ist set appropriately.

Referenced by japi_start_server().