REDACTED-rig/src/3rdparty/clib-net
Ben Gräf 1ce9d2bf3c Implemented CN-Heavy algo, Algo tests and fixed n-loop variants (#86)
* Debouncing of connection retry when connecting donation server fails
* When PoW variant is set on proxy, it will overrule local set PoW
* Implementation of cn_heavy algo
* Added self test for cn-heavy
* Fixed n-loop variant of powV2 and cn-heavy
* Fixed n-loop variant of powV2 and added cn-heavy for ARM
* Fixing n-loop for arm
* Limited cn-heavy to max hashfactor 3 on higher seltest fails.
* Removed a lot of casts
* Fixed algo selftest
2018-04-07 21:20:24 +02:00
..
deps/buffer Fixed TLS build on Windows GCC/MVSC 2018-03-01 17:44:15 +01:00
include Fixed reconnecting in case of errors 2018-03-30 21:57:41 +02:00
src Implemented CN-Heavy algo, Algo tests and fixed n-loop variants (#86) 2018-04-07 21:20:24 +02:00
CHANGELOGS Added clibs-net and clibs-buffer to 3rdparty 2018-02-25 22:10:49 +01:00
Makefile Added clibs-net and clibs-buffer to 3rdparty 2018-02-25 22:10:49 +01:00
readme.md Added clibs-net and clibs-buffer to 3rdparty 2018-02-25 22:10:49 +01:00

net-client

Simple network client

Requirement

  • libuv 0.10.x

  • buffer 0.2.0

Installation

$ clib install clibs/net
$ git clone https://github.com/joyent/libuv.git deps/libuv
$ checkout v0.10.25

Run tests

make test
./test

Example

static void 
imap_parser(net_t * net, size_t read, char * buf) {
  printf("%s\n", buf);
  printf("%zu\n", read);
}

int 
main(int argc, char *argv[]) {
  ssl_init();
  tls_ctx * ctx = tls_ctx_new();
  net_t * net = net_new("imap.gmail.com", 993); 
  net->onRead = imap_parser;

  // convert this socket to ssl
  net_set_tls(net, ctx);
  net_connect(net);

  uv_run(net->loop, UV_RUN_DEFAULT);
}

License

MIT