Android Question Socket Array: handle connected event with only 1 sub

ardillaprogramadora

Member
Licensed User
Hello, i have a socket array:

Dim Sockets(20) As Socket

I would like to handle all the connected socket events with only one function, something like this:

Sub Sockets()_Connected(Connected As Boolean, i As Int)As Boolean
End Sub


EDIT: i tried this, but didnt work:

Sub Sockets_Connected(Connected As Boolean)As Boolean
Dim s As Socket
s = Sender

If s.Connected = True Then
ToastMessageShow("Connected",True)
End If
End Sub


any ideas?
 
Last edited:

MarkusR

Well-Known Member
Licensed User
Longtime User
where/how you initialized this sockets? (because event name)
B4X:
    Sockets(0).Initialize("Socket")
    '...
or
B4X:
.InitializeSSLAcceptAll("Socket")
etc
 
Last edited:
Upvote 0
Top