TcpListener.Start() does not open the port
- by SoMoS
Hello,
I have a class that inherits from the TcpListener, this class Shadows the Start method just to call the base Start() and the base BeginAcceptTcpClient(). From time to time the method is called but the port is not opened (netstat does not show the port open).
The class looks like this
Public Class ExtendedTcpListener
Inherits System.Net.Sockets.TcpListener
Public Shadows Sub Start()
SyncLock (m_stopLock)
MyBase.Start()
MyBase.BeginAcceptTcpClient(AddressOf Me.CompleteAcceptTcpClient, Me)
My.Application.Log.WriteEntry("Extended Tcp Listener started ...", TraceEventType.Verbose)
End SyncLock
End Sub
Any idea on what's happening or how to debug the issue? As the Start() is called without exception I expected to find the port always opened (the log is always written).
Extra information: when the Start method works fine it works each time until app is restarted. When the Start method does not work it won't work again until the app is restarted.