Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

object already loaded

$
0
0
Code:

Private Function GetAvailableSocketIndex() As Integer
    Dim AvailIndex As Integer
    Dim SocketElement As Variant
   
    AvailIndex = 0
   
    ' First check for available sockets
   
    For Each SocketElement In AcceptedSocket
        If AcceptedSocket(SocketElement.Index).State = sckClosed Then
            If SocketElement.Index <> 0 Then AvailIndex = SocketElement.Index
        End If
    Next SocketElement
   
    ' Next, if AvailIndex is 0 at this point, then we either don't have a created
    ' winsock that is closed, or we only have the original winsock, which we don't
    ' want to use.  Therefore, we need to create a winsock and pass out it's index.
   
    If AvailIndex = 0 Then
        AvailIndex = AcceptedSocket.Count
Load AcceptedSocket(AvailIndex)
    End If
   
    GetAvailableSocketIndex = AvailIndex
End Function


Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>