Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When we communicate with two different computers we communicate by audio.

the code as follow:
If one computer's ip is 192.168.1.1 and the other is 192.168.1.40 then we send the audio by port 11000 and receive the audio at port 9901.
C#
socket  r = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
the part of code about receive audio
           byte[] br;
            r.Bind(new IPEndPoint(IPAddress.Any,9901));
            EndPoint send = (EndPoint)new IPEndPoint(IPAddress.Parse("192.168.1.1"), 9901);
            while (true)
                {
                br = new byte[16384];
                r.ReceiveFrom (br,ref send );
                m_Fifo.Write(br, 0, br.Length);
                }
r.SendTo(m_RecBuffer, new IPEndPoint(IPAddress.Parse("192.168.1.1"),11000));

Now, I use the code to comunicate with a 51DSP(we are communication by UDP Protocal). Ip and port are same as before but i cant receive the UDP packets which came from the 51DSP.

I hope someone who can help me to solve the problem.
Posted
Updated 28-Jul-10 5:33am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900