Can I send and receive UDP datagrams on same socket,I am using for TCP communication.There exist multimedia communication in my application for which I have to use UDP for communication.If i create a new socket it threw an exception for properties of LingerState and NoDelay.When I Assigns the Old Socket Instance to other Socket variable it doesn't Allow me to change the properties as most of the properties are read Only.I have to Send data in the TCP connected Area.
*Code *
Socket SendingSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPEndPoint Endp = new IPEndPoint(IPAddress.Parse("192.168.3.233"), port);
SendingSocket.Bind(Endp);
while (SendingSocket.Connected)
{
string Message = "Testing Message Sending Over UDP"; ASCIIEncoding Encode = new ASCIIEncoding();
byte[] MessageBytes = Encode.GetBytes(Message);
SendingSocket.SendTo(MessageBytes, 0, MessageBytes.Length, SocketFlags.None, Endp); }'