GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - andrew-canaday/libbsat: "Be smart about timeouts" libev timeout utility library.

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
example
example
 
 
include
include
 
 
lib
lib
 
 
m4
m4
 
 
test
test
 
 
util
util
 
 
.gitignore
.gitignore
 
 
API.md
API.md
 
 
COPYING
COPYING
 
 
Makefile.am
Makefile.am
 
 
README.md
README.md
 
 
autogen.sh
autogen.sh
 
 
configure.ac
configure.ac
 
 
libbsat.pc.in
libbsat.pc.in
 
 

Repository files navigation

libbsat

configure-make-check

This is a small C utility library which provides timeout management for libev-based projects.

It implements be smart about timeouts strategy #4 — which allows you to manage an arbitrary number of timeouts in O(1) time.

This makes it easy to implement things like idle disconnect and graceful shutdown timeouts, regardless of workload concurrency.

License

It's licensed under the MIT License.1

How does it work?

This library is used to manage sets of timeouts which share a common timeout delta.

There are two basic types, bsat_toq_t (a timeout queue) and bsat_timeout_t (an individual timeout item).

A server get's one timeout queue (bsat_toq_t), which has an associated timeout delta and callback function.

Individual connections have a timeout (bsat_timeout_t) which is started on connect, reset whenever there is any activity, and stopped on disconnect.

The timeout callback will be invoked for any connections which have timeouts that haven't been reset within the specified timeout period.

See Also

  • The example documentation
  • The api reference
  • libev POD: Be Smart About Timeouts

Homebrew

brew tap andrew-canaday/tap
brew install --build-from-source libbsat

Building

This project uses:

  • autoconf for configuration
  • automake for makefile generation
  • libtool to make linking easier
  • pomd4c for documentation generation
  • ymo_assert (included here) for the check targets

NOTE: the whole library is one .c file and one .h file. It should be pretty trivial to integrate it into a different build system or statically compile it into another program or library.

Configuration, build, and installation follows the classic pattern:

# NOTE: this assumes you're in the source root directory.

# Generate the configure script and ancillary build files:
./autogen.sh

# Create a build directory and cd into it:
mkdir -p ./build ; cd ./build

# configure, make, make check, and make install!
../configure --prefix=/my/installation/prefix \
    && make \
    && make check \
    && make install

Example Server

The example server is an automake "extra" target. You can build it like so:

# NOTE: assumes you are in the "build" directory above.

# Build it:
make -C ./example bsat_example

# Run it:
./example/bsat_example

1 "Wait a minute! Aren't you one of those GPL nuts?"
Yes, but this library is very small and it's just a naive implementation of the strategy documented in the link above.

About

"Be smart about timeouts" libev timeout utility library.

Topics

clibevmit-licensetimeouts

Resources

Readme
License
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.