I invocker Active Member Oct 21, 2022 #1 How can remove item from tableview when client is disconnect b4a client B4X: Copy Dim Buffer1() As Byte Buffer1 = info.GetBytes("UTF8") AStreams.Write2(Buffer1, 0, Buffer1.Length) b4j server B4X: Copy listclients.AddAll(opt) listclients=RemoveDuplicates(listclients) listclients.RemoveAt(0) Dim row(11) As Object For Each s In listclients row(i)=s i=i+1 Next Table.Items.Add(row)
How can remove item from tableview when client is disconnect b4a client B4X: Copy Dim Buffer1() As Byte Buffer1 = info.GetBytes("UTF8") AStreams.Write2(Buffer1, 0, Buffer1.Length) b4j server B4X: Copy listclients.AddAll(opt) listclients=RemoveDuplicates(listclients) listclients.RemoveAt(0) Dim row(11) As Object For Each s In listclients row(i)=s i=i+1 Next Table.Items.Add(row)
Solution Erel Oct 24, 2022 You need to have a list or some other collection with the details of the connected clients. Whenever this list is updated, clear the table and fill it again.
You need to have a list or some other collection with the details of the connected clients. Whenever this list is updated, clear the table and fill it again.
I invocker Active Member Oct 22, 2022 #2 how can detect if client is disconnect and remove it from tableview Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2022 #3 You need to handle AStream terminated and error events. Upvote 0
I invocker Active Member Oct 23, 2022 #4 thank' s fo replay I don't knew How do it ,did ou mean like this Dim astream As AsyncStreams = Sender Upvote 0
thank' s fo replay I don't knew How do it ,did ou mean like this Dim astream As AsyncStreams = Sender
Erel B4X founder Staff member Licensed User Longtime User Oct 24, 2022 #5 It depends on how you handle multiple clients. The best way to do it is by implementing all relevant code in a class and creating a class instance for each connection. Example here: https://www.b4x.com/android/forum/threads/mjpeg-cctv-server.73792/#content Upvote 0
It depends on how you handle multiple clients. The best way to do it is by implementing all relevant code in a class and creating a class instance for each connection. Example here: https://www.b4x.com/android/forum/threads/mjpeg-cctv-server.73792/#content
I invocker Active Member Oct 24, 2022 #6 thank' s mr erel i seen this example before, the problem is to link with tableview. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 24, 2022 #7 You need to have a list or some other collection with the details of the connected clients. Whenever this list is updated, clear the table and fill it again. Upvote 0 Solution
You need to have a list or some other collection with the details of the connected clients. Whenever this list is updated, clear the table and fill it again.
I invocker Active Member Oct 25, 2022 #8 Thank you mr erel I will modify the code and then come back Upvote 0