Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Chiguireitor
addrindexrs
Commits
41899310
Unverified
Commit
41899310
authored
Jun 02, 2018
by
Roman Zeyde
Browse files
Handle multiple RPC clients in parallel
parent
2fee6ea0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
TODO.txt
TODO.txt
+0
-1
src/rpc.rs
src/rpc.rs
+6
-3
No files found.
TODO.txt
View file @
41899310
= Electrum
Update height to -1 for txns with any unconfirmed input (https://electrumx.readthedocs.io/en/latest/protocol-basics.html#status)
Snapshot DB after successful indexing - and run queries on this snapshot
Handle multiple RPC client in parallel
Figure out graceful shutting down RPC server
= Bitcoind
...
...
src/rpc.rs
View file @
41899310
...
...
@@ -357,8 +357,11 @@ pub fn start(addr: &SocketAddr, query: Arc<Query>) -> thread::JoinHandle<()> {
info!
(
"RPC server running on {}"
,
addr
);
thread
::
spawn
(
move
||
loop
{
let
(
stream
,
addr
)
=
listener
.accept
()
.expect
(
"accept failed"
);
info!
(
"[{}] connected peer"
,
addr
);
Connection
::
new
(
query
.clone
(),
stream
,
addr
)
.run
();
info!
(
"[{}] disconnected peer"
,
addr
);
let
query
=
query
.clone
();
thread
::
spawn
(
move
||
{
info!
(
"[{}] connected peer"
,
addr
);
Connection
::
new
(
query
,
stream
,
addr
)
.run
();
info!
(
"[{}] disconnected peer"
,
addr
);
});
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment