maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Functions | Variables
echo_server.c File Reference
`#include <libusockets.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
Include dependency graph for echo_server.c:

Go to the source code of this file.

## Classes
struct | echo_socket
struct | echo_context

## Functions
void | on_wakeup (struct us_loop_t *loop)
void | on_pre (struct us_loop_t *loop)
void | on_post (struct us_loop_t *loop)
struct us_socket_t * | on_echo_socket_writable (struct us_socket_t *s)
struct us_socket_t * | on_echo_socket_close (struct us_socket_t *s, int code, void *reason)
struct us_socket_t * | on_echo_socket_end (struct us_socket_t *s)
struct us_socket_t * | on_echo_socket_data (struct us_socket_t *s, char *data, int length)
struct us_socket_t * | on_echo_socket_open (struct us_socket_t *s, int is_client, char *ip, int ip_length)
struct us_socket_t * | on_echo_socket_timeout (struct us_socket_t *s)
int | main ()

## Variables
const int | SSL = 1

## Class Documentation

## ◆ echo_socket

struct echo_socket

Definition at line 11 of file echo_server.c.

Collaboration diagram for echo_socket:

Class Members
char * | backpressure |
int | length |

## ◆ echo_context

struct echo_context

Definition at line 17 of file echo_server.c.

Collaboration diagram for echo_context:

## Function Documentation

## ◆ main()

int main | ( |  | ) |

Definition at line 122 of file echo_server.c.

References us_socket_context_options_t::cert_file_name, us_socket_context_options_t::key_file_name, us_socket_context_t::loop, on_echo_socket_close(), on_echo_socket_data(), on_echo_socket_end(), on_echo_socket_open(), on_echo_socket_timeout(), on_echo_socket_writable(), on_post(), on_pre(), on_wakeup(), us_socket_context_options_t::passphrase, SSL, us_create_loop(), us_create_socket_context(), us_loop_run(), us_socket_context_listen(), us_socket_context_on_close(), us_socket_context_on_data(), us_socket_context_on_end(), us_socket_context_on_open(), us_socket_context_on_timeout(), and us_socket_context_on_writable().

Here is the call graph for this function:

## ◆ on_echo_socket_close()

struct us_socket_t * on_echo_socket_close | ( | struct us_socket_t * | s,
|  | int | code,
|  | void * | reason
| ) |  |

Definition at line 60 of file echo_server.c.

References echo_socket::backpressure, SSL, and us_socket_ext().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_echo_socket_data()

struct us_socket_t * on_echo_socket_data | ( | struct us_socket_t * | s,
|  | char * | data,
|  | int | length
| ) |  |

Definition at line 77 of file echo_server.c.

References echo_socket::backpressure, echo_socket::length, SSL, us_socket_ext(), us_socket_timeout(), and us_socket_write().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_echo_socket_end()

struct us_socket_t * on_echo_socket_end | ( | struct us_socket_t * | s | ) |

Definition at line 71 of file echo_server.c.

References SSL, us_socket_close(), and us_socket_shutdown().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_echo_socket_open()

struct us_socket_t * on_echo_socket_open | ( | struct us_socket_t * | s,
|  | int | is_client,
|  | char * | ip,
|  | int | ip_length
| ) |  |

Definition at line 101 of file echo_server.c.

References echo_socket::backpressure, echo_socket::length, SSL, us_socket_ext(), and us_socket_timeout().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_echo_socket_timeout()

struct us_socket_t * on_echo_socket_timeout | ( | struct us_socket_t * | s | ) |

Definition at line 117 of file echo_server.c.

References SSL, and us_socket_close().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_echo_socket_writable()

struct us_socket_t * on_echo_socket_writable | ( | struct us_socket_t * | s | ) |

Definition at line 37 of file echo_server.c.

References echo_socket::backpressure, echo_socket::length, SSL, us_socket_ext(), us_socket_timeout(), and us_socket_write().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_post()

void on_post | ( | struct us_loop_t * | loop | ) |

Definition at line 32 of file echo_server.c.

Referenced by main().

Here is the caller graph for this function:

## ◆ on_pre()

void on_pre | ( | struct us_loop_t * | loop | ) |

Definition at line 27 of file echo_server.c.

Referenced by main().

Here is the caller graph for this function:

## ◆ on_wakeup()

void on_wakeup | ( | struct us_loop_t * | loop | ) |

Definition at line 22 of file echo_server.c.

Referenced by main().

Here is the caller graph for this function:

## Variable Documentation

## ◆ SSL

const int SSL = 1

Definition at line 4 of file echo_server.c.

Referenced by main(), on_echo_socket_close(), on_echo_socket_data(), on_echo_socket_end(), on_echo_socket_open(), on_echo_socket_timeout(), and on_echo_socket_writable().