Q:

SocketException when trying to listen to multiple ports simultaneously C#

I'm writing a HTTP server and I would like to listen to two ports at the same time. 
I created two sockets and two endPoints and I'm passing them to threads. 
I'm getting the following exception when the code is at socket.Bind(endPoint);:
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted

The code:
public class HTTPServer
{
    private readonly IPEndPoint m_LocalEndPoint=new IPEndPoint(IPAddress.Any, 8082);;
    private readonly IPEndPoint m_SecuredLocalEndPoint=new IPEndPoint(IPAddress.Any, 8083);
    private readonly Socket m_SocketListener=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);;
    private readonly Socket m_SecureSocketListener=new Socket(AddressFamily.InterNetwork, SocketType.Stream,ProtocolType.Tcp);; 

    public void Start()
        {

            Thread t = ThreadFactory.Create(() => AsyncStart(m_LocalEndPoint,m_SocketListener));
            t.Name = string.Format("HTTPServer({0})", this);
            t.Start();
            Thread sucureThread = ThreadFactory.Create(() => AsyncStart(m_SecuredLocalEndPoint,m_SecureSocketListener));
            sucureThread.Name = string.Format("HTTPSServer({0})", m_SecuredLocalEndPoint);
            sucureThread.Start();
        }

    private void AsyncStart(IPEndPoint endPoint, Socket socket)
        {
            try
            {
                socket.Bind(endPoint);
                socket.Listen(MAX_NUMBER_OF_PENDING_CONNECTIONS);
                Socket clientSocket = socket.Accept();
            }
            catch (Exception ex)
            {
            }          
        }
}

I don't know if it,ד relevant to the issue, but the reason I want to listen to two ports is that I want to be able to handle HTTP and HTTPS requests in the same server. 
So if a client sends a packet to port 8082 I will handle it as 
a HTTP request and if he sends to 8083 I will handle it as a HTTPS one.  What am I missing or how can I solve this problem (avoid the SocketException) and still listen to the two ports?

A:

If the socket is failing consistently on a particular port, it's likely that there is another process listening to the port.
Run a port scan on the local system to confirm the port is free.

