Skip to content

Commit

Permalink
Fix/Networking: Removed non-working constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Jan 30, 2024
1 parent e40a679 commit 2497ca1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
9 changes: 0 additions & 9 deletions src/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,6 @@ std::runtime_error(w), fullWhat(w)
fullWhat += errTxt;
}

SocketNetworking::SocketNetworking(const std::string& _addr, int _port,
size_t _bufSize, unsigned _timeOut_ms,
bool _bBroadcast) :
f_port(_port), f_addr(_addr)
{
// open the socket
Open(_addr, _port, _bufSize, _timeOut_ms, _bBroadcast);
}

// cleanup: make sure the socket is closed and all memory cleanup up
SocketNetworking::~SocketNetworking()
{
Expand Down
13 changes: 1 addition & 12 deletions src/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ class SocketNetworking
public:
/// Default constructor is not doing anything
SocketNetworking() {}
/// Constructor creates a socket and binds it to the given address
SocketNetworking(const std::string& _addr, int _port, size_t _bufSize = 512,
unsigned _timeOut_ms = 0, bool _bBroadcast = false);
/// Destructor makes sure the socket is closed
virtual ~SocketNetworking();

Expand Down Expand Up @@ -201,11 +198,7 @@ class UDPReceiver : public SocketNetworking
public:
/// Default constructor is not doing anything
UDPReceiver() : SocketNetworking() {}
/// Constructor creates a socket and binds it to the given address
UDPReceiver(const std::string& _addr, int _port, size_t _bufSize = 512,
unsigned _timeOut_ms = 0) :
SocketNetworking(_addr,_port,_bufSize,_timeOut_ms) {}


protected:
/// Sets flags to AI_PASSIVE, AF_INET, SOCK_DGRAM, IPPROTO_UDP
void GetAddrHints (struct addrinfo& hints) override;
Expand Down Expand Up @@ -299,10 +292,6 @@ class TCPConnection : public SocketNetworking
public:
/// Default constructor is not doing anything
TCPConnection() : SocketNetworking() {}
/// Constructor creates a socket and binds it to the given address
TCPConnection(const std::string& _addr, int _port, size_t _bufSize = 512,
unsigned _timeOut_ms = 0) :
SocketNetworking(_addr,_port,_bufSize,_timeOut_ms) {}

void Close() override; ///< also close session connection
void CloseListenerOnly(); ///< only closes the listening socket, but not a connected session
Expand Down

0 comments on commit 2497ca1

Please sign in to comment.