Use ServerConfig enum for tokio-xmpp client config
And expose connect_to_host from happy_eyeballs to let clients explicitly choose to use SRV or not. (Rename connect to connect_with_srv)
This commit is contained in:
parent
08e58e44b1
commit
7b4a6e3ace
4 changed files with 43 additions and 27 deletions
|
|
@ -8,7 +8,7 @@ use std::task::Context;
|
|||
use tokio::net::TcpStream;
|
||||
use xmpp_parsers::{ns, Element, Jid};
|
||||
|
||||
use super::happy_eyeballs::connect;
|
||||
use super::happy_eyeballs::connect_to_host;
|
||||
use super::xmpp_codec::Packet;
|
||||
use super::xmpp_stream;
|
||||
use super::Error;
|
||||
|
|
@ -43,7 +43,7 @@ impl Component {
|
|||
port: u16,
|
||||
) -> Result<XMPPStream, Error> {
|
||||
let password = password;
|
||||
let tcp_stream = connect(server, None, port).await?;
|
||||
let tcp_stream = connect_to_host(server, port).await?;
|
||||
let mut xmpp_stream =
|
||||
xmpp_stream::XMPPStream::start(tcp_stream, jid, ns::COMPONENT_ACCEPT.to_owned())
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue