Im trying to make a wrapper and need to return the local port that the new
connection/socket is being made on. The following code the RaiseEvent, the
tmpsoc.localPort is returned as 0. How do I get the localport the server is
going to be handling the new connection?
Private Sub acceptCallback(ByVal ar As IAsyncResult)
Try
Try
Dim tmpsoc As clsSocket = New clsSocket(socket.EndAccept(ar))
RaiseEvent onAccept(tmpsoc.localPort, tmpsoc)
Catch e As Exception
doError(Err.Number, Err.Description)
End Try
beginAccept()
Catch e As SocketException
doError(Err.Number, Err.Description)
Catch e As ObjectDisposedException
Close()
Catch e As Exception
doError(Err.Number, Err.Description)
End Try
End Sub