Commit Graph

11 Commits

Author SHA1 Message Date
Riccardo Casatta
561db261d3
timeout() and socks() don't return Result
The `Result` was necessary in the past because they couldn't both be set,
this is not true anymore after 7493630ed8
2022-09-13 09:27:03 +02:00
Riccardo Casatta
f200b7fc61
Implements retry, timeout, socks credential and others fixes
Retry works by checking if an non-protocol error happened during the call, if so an attempt to take a write lock on the client is made and a new client attempted
if both operationare succesfull the old_client is substituted with the new one.

Timeout is a single parameter for connect,read and write TCP timeouts, special handling is required for the following situation: cannot set a timeout with a proxy and cannot set timeout with multipl SocketAddrs

Since configurations parameter grow, a Config struct with a builder has been introduced

Some new errors variant has been introduced

Errors in reading input in the reader thread now warns other eventual threads with ChannelMessage::Error

Add github actions equivalent to travis cause travis is slow
2020-11-24 12:03:51 +01:00
Alekos Filini
f9b318c1c6
New interface 2020-07-16 14:06:49 +02:00
Alekos Filini
db4554f9e2
Test against mainnet servers 2020-07-16 14:06:25 +02:00
Alekos Filini
f37bcd59e0
New multithreaded model
This new model is based on the idea of having only one thread monitor the socket and then
distribute the responses to every other thread that's waiting.

Whenever a request is made, a new mpsc channel is created and added to an internal map.
Then, if there are not other threads waiting for pending responses, that thread will
become the "reader thread" and monitor the socket until it receives the response it was
waiting for. In the meantime, if it sees responses coming on the socket with different
ids, it will lookup the correct Sender from the internal map and send that message to
the thread that created the request in the first place.

The other threads will be waiting trying to read from their Receiver, where they will
either get the message in response to their request, or a signal to wake up and
become the new "reader thread".
2020-07-16 14:06:13 +02:00
Alekos Filini
7b4e99e80c
Revert "Move to async I/O with Tokio"
This reverts commit e1dbfd7ceb.
2020-07-09 16:11:52 +02:00
Alekos Filini
2a9278879f
Revert "Fix the internal Tokio runtime for sync methods"
This reverts commit 33f4ea2e51.
2020-07-09 16:11:33 +02:00
Alekos Filini
33f4ea2e51
Fix the internal Tokio runtime for sync methods 2020-04-14 14:55:46 +02:00
Alekos Filini
e1dbfd7ceb
Move to async I/O with Tokio 2020-04-09 10:21:38 +02:00
Alekos Filini
68cd825b16
Take a bool for SSL domain validation 2020-02-11 18:12:41 +01:00
Alekos Filini
40d78e4027
Release 0.1.0-beta.1 2020-02-06 18:15:22 +01:00