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
933014a2
Commit
933014a2
authored
Jun 25, 2009
by
jcacerec
Browse files
final prototype to connect to JamLinks Working
parent
00bd93d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/JackTrip.cpp
View file @
933014a2
...
...
@@ -237,11 +237,11 @@ void JackTrip::start()
mJackAudio
->
connectDefaultPorts
();
QThread
::
sleep
(
1
);
cout
<<
"Starting Sender Socket..."
<<
endl
;
mDataProtocolSender
->
start
();
mDataProtocolSender
->
start
();
QThread
::
sleep
(
1
);
cout
<<
"Starting Receiver Socket..."
<<
endl
;
mDataProtocolReceiver
->
start
();
...
...
src/UdpDataProtocol.cpp
View file @
933014a2
...
...
@@ -176,16 +176,11 @@ void UdpDataProtocol::run()
QHostAddress
PeerAddress
;
PeerAddress
=
mPeerAddress
;
//==============================================================================
//=======WORKING WITH SOCK DESK ================================================
//==============================================================================
int
fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
/*
int on = 1;
cout << "BEFORE BINDING" << endl;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
{
perror("setsockopt(SO_REUSEADDR) failed");
}
cout << "AFTER BINDING" << endl;
*/
// Bind local address and port
/// \todo Bind to a different port in case this one is used by a different instance
/// of the program
...
...
@@ -194,7 +189,7 @@ void UdpDataProtocol::run()
LocalIPv4Addr
.
sin_family
=
AF_INET
;
//AF_INET: IPv4 Protocol
LocalIPv4Addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
//INADDR_ANY: let the kernel decide the active address
LocalIPv4Addr
.
sin_port
=
htons
(
mLocalPort
);
//set local port
cout
<<
"mLocalPort === "
<<
mLocalPort
<<
" ==="
<<
endl
;
int
one
=
1
;
#if defined ( __LINUX__ )
...
...
@@ -214,12 +209,12 @@ void UdpDataProtocol::run()
std
::
cerr
<<
"ERROR: UDP Socket Bind Error"
<<
std
::
endl
;
std
::
exit
(
0
);
}
struct
sockaddr_in
ServerIPv4Addr
;
bzero
(
&
ServerIPv4Addr
,
sizeof
(
ServerIPv4Addr
));
ServerIPv4Addr
.
sin_family
=
AF_INET
;
//AF_INET: IPv4 Protocol
ServerIPv4Addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
//INADDR_ANY: let the kernel decide the active address
ServerIPv4Addr
.
sin_port
=
htons
(
mLocalPort
);
//set local port
ServerIPv4Addr
.
sin_port
=
htons
(
4464
);
//set local port
//cout << "inet_pton == " << inet_pton(AF_INET, "171.64.197.42", &ServerIPv4Addr.sin_addr) << endl;
//cout << "inet_pton == " << inet_pton(AF_INET, "192.168.177.160", &ServerIPv4Addr.sin_addr) << endl;
const
char
*
peeraddress
=
mPeerAddress
.
toString
().
toLatin1
().
constData
();
...
...
@@ -244,6 +239,16 @@ void UdpDataProtocol::run()
UdpSocket
.
setSocketDescriptor
(
fd
,
QUdpSocket
::
BoundState
,
QUdpSocket
::
WriteOnly
);
}
//==============================================================================
//==============================================================================
//QThread::msleep(1000);
...
...
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