Android Question Serversocket after disconnect is still connected

welu1805

Active Member
Licensed User
Longtime User
Hi all,

I use for testing of AsyncStreams a small app similar to AsyncStream Tutorial from Feb, 3, 2011.

At first the server starts. Then the client connects to him. In a Button_Click I can get the state of the socket from the server: True - OK.

Now the client disconnects with AstreamClient.Close and SocketClient.Close
The Button_Click still shows True.

Even if I close the client app, the server button for connected still says True.

Is this a mistake in my minds or a bug?
 
Last edited:

welu1805

Active Member
Licensed User
Longtime User
Now I used AStreamServer_Terminated. If the client disconnect the connection, this event is fired.

But I have some clients connected to one server. The AsyncStream objects are in a list object - all with the same event name. How can I determine in AStreamServer_Terminated. which client this is?

The serversocket objects are also stored in a list. My idea was, to find the closed connection with socket.connected = False
 
Last edited:
Upvote 0

welu1805

Active Member
Licensed User
Longtime User
Thanks Erel for your tip with Sender keyword. I use it to find the position in the lists of AsyncStreams and sockets. Then I remove both entries.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…