|
|
@ -9,23 +9,25 @@ |
|
|
|
* according to those terms. |
|
|
|
* according to those terms. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
use async_std::net::{TcpListener, TcpStream}; |
|
|
|
//! WebSocket implementation of the Broker
|
|
|
|
use async_std::sync::Mutex; |
|
|
|
|
|
|
|
use async_std::task; |
|
|
|
use async_std::net::{TcpListener, TcpStream}; |
|
|
|
use async_tungstenite::accept_async; |
|
|
|
use async_std::sync::Mutex; |
|
|
|
use async_tungstenite::tungstenite::protocol::Message; |
|
|
|
use async_std::task; |
|
|
|
use debug_print::*; |
|
|
|
use async_tungstenite::accept_async; |
|
|
|
use futures::{SinkExt, StreamExt}; |
|
|
|
use async_tungstenite::tungstenite::protocol::Message; |
|
|
|
use crate::broker_store_config::ConfigMode; |
|
|
|
use debug_print::*; |
|
|
|
use crate::server::*; |
|
|
|
use futures::{SinkExt, StreamExt}; |
|
|
|
use p2p_stores_lmdb::broker_store::LmdbBrokerStore; |
|
|
|
use crate::broker_store_config::ConfigMode; |
|
|
|
use p2p_stores_lmdb::repo_store::LmdbRepoStore; |
|
|
|
use crate::server::*; |
|
|
|
use std::fs; |
|
|
|
use p2p_stores_lmdb::broker_store::LmdbBrokerStore; |
|
|
|
use std::sync::Arc; |
|
|
|
use p2p_stores_lmdb::repo_store::LmdbRepoStore; |
|
|
|
use tempfile::Builder; |
|
|
|
use std::fs; |
|
|
|
use std::{thread, time}; |
|
|
|
use std::sync::Arc; |
|
|
|
|
|
|
|
use tempfile::Builder; |
|
|
|
pub async fn connection_loop(tcp: TcpStream, mut handler: ProtocolHandler) -> std::io::Result<()> { |
|
|
|
use std::{thread, time}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async fn connection_loop(tcp: TcpStream, mut handler: ProtocolHandler) -> std::io::Result<()> { |
|
|
|
let mut ws = accept_async(tcp).await.unwrap(); |
|
|
|
let mut ws = accept_async(tcp).await.unwrap(); |
|
|
|
let (mut tx, mut rx) = ws.split(); |
|
|
|
let (mut tx, mut rx) = ws.split(); |
|
|
|
|
|
|
|
|
|
|
|