Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jacktrip
Commits
08343cb8
Commit
08343cb8
authored
Nov 26, 2010
by
jcacerec
Browse files
added DNS Support lookup
parent
9b7c101b
Changes
2
Hide whitespace changes
Inline
Side-by-side
jacktrip/CHANGESLOG.txt
View file @
08343cb8
---
1.1
trunk
- (added) Support for RtAudio. Jacktrip can now be used without Jack
- (added) New port to Windows XP and Windows Vista
- (added) Multiclient Server
- (added) DNS Look-up support
---
1.0.5
...
...
jacktrip/src/UdpDataProtocol.cpp
View file @
08343cb8
...
...
@@ -39,6 +39,8 @@
#include
"jacktrip_globals.h"
#include
"JackTrip.h"
#include
<QHostInfo>
#include
<cstring>
#include
<iostream>
#include
<cstdlib>
...
...
@@ -90,12 +92,20 @@ UdpDataProtocol::~UdpDataProtocol()
//*******************************************************************************
void
UdpDataProtocol
::
setPeerAddress
(
const
char
*
peerHostOrIP
)
throw
(
std
::
invalid_argument
)
{
mPeerAddress
.
setAddress
(
peerHostOrIP
);
// Get DNS Address
QHostInfo
info
=
QHostInfo
::
fromName
(
peerHostOrIP
);
if
(
!
info
.
addresses
().
isEmpty
())
{
// use the first IP address
mPeerAddress
=
info
.
addresses
().
first
();
//cout << "UdpDataProtocol::setPeerAddress IP Address Number: "
// << mPeerAddress.toString().toStdString() << endl;
}
// check if the ip address is valid
if
(
mPeerAddress
.
isNull
()
)
{
QString
error_message
=
"Incorrect presentation format address
\n
'"
;
error_message
.
append
(
peerHostOrIP
);
error_message
.
append
(
"' is not a valid IP address"
);
error_message
.
append
(
"' is not a valid IP address
or Host Name
"
);
//std::cerr << "ERROR: Incorrect presentation format address" << endl;
//std::cerr << "'" << peerHostOrIP <<"' does not seem to be a valid IP address" << endl;
//throw std::invalid_argument("Incorrect presentation format address");
...
...
Write
Preview
Supports
Markdown
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