Android Question IRC Library - can't closse lost connection

scsjc

Well-Known Member
Licensed User
Longtime User
Hello

I'm using IRC CLASS, and I run it on a service, but I have a problem.
At the time I lose the connection, and reconnect, I think it keeps the old socket and connects 2 times.
I do not know how to close the class before reconnecting.

I've tried doing IRC.DISCONECT but it does not work, i'm try to send commands "QUIT" "SERVER" to attempt disconect before connect but dont work. My code to recconection is:

B4X:
public Sub IRCConnect
        IRC.Initialize(Me, "chat", host, port, nick, channel)
        IRC.Send("QUIT")
        IRC.Disconnect
        IRC.Connect
        IRC.Send("SERVER " & host & ":" & port & " -i nick " & nick)
End Sub
 

scsjc

Well-Known Member
Licensed User
Longtime User
I am monitoring continuously through PING if there is connection to the server, at the moment that it does a ping and does not have pong in XXX seconds, is when in fact there is no connection, and then reconnect. This works well.

But the problem is that the service gets twice the same information, since I can not close with IRC.Disconnect.
I think every time do IRC.Initialize, that create a socket that stays open even though have lost the connection
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…