scsjc Well-Known Member Licensed User Longtime User Mar 30, 2017 #1 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: Code: Copy 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
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: Code: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2017 #2 What are you communicating with? This code doesn't look correct. The communication should happen in the background which means that you call Disconnect before the data was sent. Upvote 0
What are you communicating with? This code doesn't look correct. The communication should happen in the background which means that you call Disconnect before the data was sent.
scsjc Well-Known Member Licensed User Longtime User Mar 30, 2017 #3 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
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
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2017 #4 I'm not familiar with this protocol. Will probably be better to implement it yourself with Socket + AsyncStreams. Upvote 0
I'm not familiar with this protocol. Will probably be better to implement it yourself with Socket + AsyncStreams.