mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
Removed DNS resolving as it was not needed
This commit is contained in:
parent
77a68e4a0c
commit
3d95f08ef4
4 changed files with 10 additions and 23 deletions
|
|
@ -2,7 +2,7 @@ use std::io::{Read, Write};
|
|||
use std::net;
|
||||
use crate::{GDError, GDResult};
|
||||
use crate::protocols::types::TimeoutSettings;
|
||||
use crate::utils::complete_address;
|
||||
use crate::utils::address_and_port_as_string;
|
||||
|
||||
static DEFAULT_PACKET_SIZE: usize = 1024;
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ pub struct TcpSocket {
|
|||
|
||||
impl Socket for TcpSocket {
|
||||
fn new(address: &str, port: u16) -> GDResult<Self> {
|
||||
let complete_address = complete_address(address, port)?;
|
||||
let complete_address = address_and_port_as_string(address, port)?;
|
||||
let socket = net::TcpStream::connect(complete_address).map_err(|e| GDError::SocketConnect(e.to_string()))?;
|
||||
|
||||
Ok(Self {
|
||||
|
|
@ -57,7 +57,7 @@ pub struct UdpSocket {
|
|||
|
||||
impl Socket for UdpSocket {
|
||||
fn new(address: &str, port: u16) -> GDResult<Self> {
|
||||
let complete_address = complete_address(address, port)?;
|
||||
let complete_address = address_and_port_as_string(address, port)?;
|
||||
let socket = net::UdpSocket::bind("0.0.0.0:0").map_err(|e| GDError::SocketBind(e.to_string()))?;
|
||||
|
||||
Ok(Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue