Commit Graph

37 Commits

Author SHA1 Message Date
Dimon4eg
401fc39879 fix windows build (#29)
* fix windows build

* fix for Unix

* Fix build if TLS is OFF

* add OpenSSL req to ws

* Fix build on Mac

* fix tests for windows
2019-04-16 08:51:57 -07:00
Benjamin Sergeant
0635313566 Feature/redis (#23)
* Fix warning

* (cmake) add a warning about 32/64 conversion problems.

* simple redis clients

* can publish to redis

* redis subscribe

* display messages received per second

* verbose flag

* (cmake) use clang only compile option -Wshorten-64-to-32 when compiling with clang
2019-03-20 14:29:02 -07:00
Benjamin Sergeant
523a6e989a make PollResultType an enum class 2019-03-19 09:29:57 -07:00
Benjamin Sergeant
13f4aee5ee fix bug with isReadyToWrite 2019-03-18 22:05:04 -07:00
Benjamin Sergeant
eb6ee52aaa use milliseconds 2019-03-18 20:17:44 -07:00
Benjamin Sergeant
572a217050 no default parameters for isReadyToWrite and isReadyToRead 2019-03-18 14:31:21 -07:00
Benjamin Sergeant
d58798e36c when trying to flush the send buffer, use select to wait until it is possible instead of using sleep to retry at a given frequency 2019-03-18 14:25:27 -07:00
Benjamin Sergeant
b91dc77d6f select interrupt cleanup 2019-03-14 18:37:38 -07:00
Benjamin Sergeant
b5e7fb20b6 replace uint8_t with uint64_t for the send/close requests types / use named variable to index into the _fildes array 2019-03-14 15:03:57 -07:00
Benjamin Sergeant
08c2cdbf1d send can fail silently when sending would block (EWOULDBLOCK return for send) (#18)
* try to use a pipe for communication

* flush send buffer on the background thread

* cleanup

* linux fix / linux still use event fd for now

* cleanup
2019-03-13 23:09:45 -07:00
Benjamin Sergeant
c202f8cf1d Socket code refactoring, plus stop polling with a 1s timeout in readBytes while we only want to poll with a 1ms timeout 2019-03-04 13:40:15 -08:00
Benjamin Sergeant
0c226c7629 readBytes does not read bytes one by one but in chunks 2019-03-02 21:11:16 -08:00
Benjamin Sergeant
a9e772f330 create a blocking + cancellable Socket::readBytes method 2019-03-02 15:16:46 -08:00
Benjamin Sergeant
86cc76388e create a blocking + cancellable Socket::readBytes method 2019-03-02 11:01:51 -08:00
Benjamin Sergeant
932bb732e0 Feature/send large message (#14)
* introduce send fragment

* can pass a fin frame

* can send messages which are a perfect multiple of the chunk size

* set fin only for last fragment

* cleanup

* last fragment should be of type CONTINUATION

* Add simple send and receive programs

* speedups receiving + better way to wait for thing

* receive speedup by using linked list of chunks instead of large array

* document bug

* use chunks to receive data

* trailing spaces
2019-02-20 18:59:07 -08:00
Benjamin Sergeant
907605c59c windows build fix 2019-01-27 10:46:02 -08:00
Benjamin Sergeant
58921592c8 constexpr to declare number of fds 2019-01-26 21:01:36 -08:00
Benjamin Sergeant
b9c49c38ed linux fix 2019-01-26 20:57:48 -08:00
Benjamin Sergeant
76c97027c8 remove shutdown call 2019-01-26 20:54:23 -08:00
Benjamin Sergeant
5db3620f49 rebase poll branch 2019-01-26 20:50:25 -08:00
Benjamin Sergeant
a8b6573f96 hearbeat 2019-01-24 12:42:49 -08:00
Benjamin Sergeant
8a0afef825 check select errors better 2019-01-07 11:18:00 -08:00
Benjamin Sergeant
60dc765178 unittest + compiler warnings 2019-01-05 21:10:08 -08:00
Benjamin Sergeant
0fd06bb592 int -> ssize_t for socker recv and send 2019-01-05 20:53:50 -08:00
Benjamin Sergeant
9641c8cf49 header refactoring 2019-01-05 20:38:43 -08:00
Benjamin Sergeant
3eef8fba27 unittest on appveyor 2019-01-04 17:28:13 -08:00
Benjamin Sergeant
cc43357fb4 Socket::readLine works with arbitrary long lines 2019-01-03 18:47:01 -08:00
Benjamin Sergeant
bce5ef2dca timeout is configurable 2019-01-03 18:33:08 -08:00
Benjamin Sergeant
097c7e5397 server unittest for validating client request / new timeout cancellation handling (need refactoring) 2019-01-02 16:08:32 -08:00
Benjamin Sergeant
2b136b2981 refactoring + cancellation was buggy during http upgrade 2019-01-02 07:45:07 -08:00
Benjamin Sergeant
ea07afcc0b can create a socket from a fd 2018-12-29 21:53:33 -08:00
Benjamin Sergeant
cbadecab33 non blocking dns lookup 2018-12-14 16:28:17 -08:00
Benjamin Sergeant
8c079787f0 add cancellation support while connecting, to speed up WebSocket::stop 2018-12-09 17:56:20 -08:00
Benjamin Sergeant
62528e6a0b http upgrade and connections use non blocking sockets 2018-12-09 14:07:40 -08:00
Benjamin Sergeant
cf0045a483 stopping connection on Linux does not close the socket, which can create problem when re-starting the connection 2018-11-01 17:02:49 -07:00
Benjamin Sergeant
71b40c6d6c Windows support (no TLS yet) 2018-10-08 21:44:54 -07:00
Benjamin Sergeant
9b8d6cedfe First import 2018-09-27 14:57:19 -07:00