Page 1 of 1

about sessionInit and sessionClose function

Posted: Tue Mar 05, 2013 1:32 am
by fantce
Hi everyone I am a newbie in Transmisson,
I read that the tr_sessionInit() is called when I add a new task
(BT task); and when I delete the BT task tr_sessionClose()
should be called. That means every task will create a libevent
thread and a Web thread when we call tr_sessionInit().
Am I correct or I am totally wrong.
Please help, any advice will be appreciated.

Re: about sessionInit and sessionClose function

Posted: Tue Mar 05, 2013 1:58 am
by fantce
Put it in another way, dose transmission require a multi-threaded libevent lib? Or
a single thread libevent can work with Transmission fine , just like I mentioned above
adding a task means creating a libevent thread, does that mean I need a multi-threaded
libevent lib?
thanks in advance

Re: about sessionInit and sessionClose function

Posted: Tue Mar 05, 2013 6:17 am
by fantce
My question is for each new task(add torrent) created; should I init a new session < call tr_sessionInit( )> ?
and when task is deleted , should I call sessionClose()?
or there is only one session inited and I should use

tr_torrent * tr_torrentNew( const tr_ctor * ctor, int * setmeError );
to add new torrent.
and use
void tr_torrentFree( tr_torrent * torrent );
to remove torrent.
by the way, I didn't find any API called torrentInit() and closeTorrent()

Please correct me if I am wrong