send client their own packet for solo mixer testing

This commit is contained in:
Stephen Birarda 2013-02-13 16:14:04 -08:00
parent 4fc9dd6323
commit 4270cfe2b4
2 changed files with 6 additions and 8 deletions

View file

@ -171,10 +171,11 @@ void *sendBuffer(void *args)
}
for(int as = 0; as < BUFFER_LENGTH_SAMPLES; as++) {
long longSample = previousOutput != NULL
? masterMix[as] - previousOutput[as]
: masterMix[as];
// long longSample = previousOutput != NULL
// ? masterMix[as] - previousOutput[as]
// : masterMix[as];
long longSample = masterMix[as];
int16_t shortSample;
@ -195,7 +196,7 @@ void *sendBuffer(void *args)
}
sentBytes = audioSocket->send(agents[a].address, agents[a].port, (void *) clientMix, BUFFER_LENGTH_BYTES);
sentBytes = audioSocket->send(agents[a].address, agents[a].port, clientMix, BUFFER_LENGTH_BYTES);
if (sentBytes < BUFFER_LENGTH_BYTES) {
std::cout << "Error sending mix packet! " << sentBytes << strerror(errno) << "\n";

View file

@ -51,10 +51,7 @@ UDPSocket::~UDPSocket() {
// Receive data on this socket with retrieving address of sender
bool UDPSocket::receive(void *receivedData, int *receivedBytes) {
*receivedBytes = recvfrom(handle, receivedData, MAX_BUFFER_LENGTH_BYTES,
0, (sockaddr *)&senderAddress, &addLength);
return (*receivedBytes > 0);
return receive(&senderAddress, receivedData, receivedBytes);
}
// Receive data on this socket with the address of the sender