Chat, when pda turn off...

dibesw

Active Member
Licensed User
Longtime User
Does anybody tell me why and what is the resolution when use chitchat and client turn off pda? When pda turn off an then turn on, system give error. How is the solve?

Thanks for replay
 
Last edited:

dibesw

Active Member
Licensed User
Longtime User
Which error do you get? And from which sub?

HI Erel, thank you.

I use chit-chat for to make experience for network.dll.
PC is server and pda is client and all works well.
Then when I turn off pda, and subsequently I turn it on, there a message system error (on pda):
An error occurred on sub _main_tmrwaitfordata_tick impossible display error message....
If pda is always on no error issued.
Perhaps pda lost connect to server?
What do you think about?

Sorry for my english.

Thank you in advance
dibesw
 

dibesw

Active Member
Licensed User
Longtime User
When the pda is turned off the connection is lost. The connection is not automatically reestablished.
You can catch this error and then try to reconnect.

Thanks, I have the resolution.

I have modified project:

B4X:
Sub btnSend_Click
    ErrorLabel(noconn)
   If blnServer = False Then
      stream.WriteString(name & ">" & txtSend.Text)
   Else
      SendToAllClients(name & ">" & txtSend.Text,"") 'Data is sent to all clients.
   End If
   txtReceive.Text = txtReceive.Text & CRLF & txtSend.Text
   txtReceive.SelectionStart = StrLength(txtReceive.Text)-1
   txtReceive.ScrollToCaret
   txtSend.Text = ""
   txtSend.Focus
   Return 
noconn:
    Client.Close
    Client.New1
    Connect(IPAddress(0))
    Msgbox("Reconnected OK")
End Sub

With label "noconn" system reconnect well.

Thanks Erel for your suggestion!!!!
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…