disconnect and a new reconnect

Duncan Berriman duncan at berrimans.co.uk
Fri Jan 10 11:39:27 EST 2014


Hi Jonas,

 

I have a similar bot and in my code I do the following:-

 

Every so often I check the connection with purple_account_get_connection and
purple_connection_get_state

If it has failed I then do a purple_account_disconnect

I then do a purple_account_set_password followed by purple_account_connect

 

I seem to remember it fails if you don't do the purple_account_set_password
before the purple_account_connect which isn't entirely intuitive!

 

Duncan

 

 

 

From: Devel [mailto:devel-bounces at pidgin.im] On Behalf Of Jonas Zinn
Sent: 10 January 2014 01:38
To: devel at pidgin.im
Subject: disconnect and a new reconnect

 

Hey all,

 

it would be nice, if someone of you could help me with a little but annoying
problem.

First of all, what I'm currently doing, in my free time I write a little
chatbot with the libpurple, 

It is more an control bot then a normal chat bot you can talk with him, but
also give him commands, which he understands

To control the room light and such stuff. But each Day I will receive an new
internet ip-address (disconnect from internet)

Then the event function triggers correctly, but then I want the bot to wait
for an minute and reconnect again.

The waiting is not the problem, but the reconnecting. 

I tried a lot of ways to reconnect like 

purple_account_connect

or

purple_account_set_enabled

 

So my question is what is a proper way to reconnect automatically after a
disconnect ?

 

br

Jonas Zinn


-- 
This message has been scanned for viruses and 
dangerous content by  <http://www.mailscanner.info/> MailScanner, and is 
believed to be clean. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pidgin.im/pipermail/devel/attachments/20140110/7fa900ef/attachment.html>


More information about the Devel mailing list