G
Guest
Hello everybody,
I'm developing an application witch receives voice from Sockets and
playback it with the waveOutWrite function..
The problem is that when I receive datas during more than 5 minuts (more
or less) the waveOutWrite function returns a INVALPARAM error.
The "ReceiveData" method is this:
private byte[] message;
private byte[] message2;
private EndPoint endPointRemote;
public byte[] ReceiveData()
{
sock.ReceiveFrom(message, ref endPointRemote);
sock.ReceiveFrom(message2, ref endPointRemote);
.....
//Join message and message2
return messagejoin;
}
if I change the method for the next to do tests, it works fine:
public byte[] ReceiveData()
{
if(count==0)
{
sock.ReceiveFrom(message, ref endPointRemote);
sock.ReceiveFrom(message2, ref endPointRemote);
count=1;
}
else
{
Thread.Sleep(100);
}
.....
//Join message and message2
return messagejoin;
}
with this test I receive only a packet and I playback it all the time.
It seems that there's a memory problem, but I don't understand because I use
global ids.
What can I do?
Do you think that if I use the UDPClient I'll have the same problem?
Regards.
I'm developing an application witch receives voice from Sockets and
playback it with the waveOutWrite function..
The problem is that when I receive datas during more than 5 minuts (more
or less) the waveOutWrite function returns a INVALPARAM error.
The "ReceiveData" method is this:
private byte[] message;
private byte[] message2;
private EndPoint endPointRemote;
public byte[] ReceiveData()
{
sock.ReceiveFrom(message, ref endPointRemote);
sock.ReceiveFrom(message2, ref endPointRemote);
.....
//Join message and message2
return messagejoin;
}
if I change the method for the next to do tests, it works fine:
public byte[] ReceiveData()
{
if(count==0)
{
sock.ReceiveFrom(message, ref endPointRemote);
sock.ReceiveFrom(message2, ref endPointRemote);
count=1;
}
else
{
Thread.Sleep(100);
}
.....
//Join message and message2
return messagejoin;
}
with this test I receive only a packet and I playback it all the time.
It seems that there's a memory problem, but I don't understand because I use
global ids.
What can I do?
Do you think that if I use the UDPClient I'll have the same problem?
Regards.