11,570 questions
The Raw socket cannot use the Bind function of Socket class to bind the port.
tian zhou
1
Reputation point
I want to create a raw socket and bind it to the specified port, but it is always bound to port 0. Why?
Here's my code.
{
Socket receiveSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Raw);
receiveSocket.Bind(new IPEndPoint(IPAddress.Parse("10.21.1.101"), 20000));
}
Developer technologies C#
Sign in to answer