about sessionInit and sessionClose function

Discussion of Transmission that doesn't fit in the other categories
Post Reply
fantce
Posts: 5
Joined: Mon Jan 14, 2013 9:42 am

about sessionInit and sessionClose function

Post 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.
fantce
Posts: 5
Joined: Mon Jan 14, 2013 9:42 am

Re: about sessionInit and sessionClose function

Post 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
fantce
Posts: 5
Joined: Mon Jan 14, 2013 9:42 am

Re: about sessionInit and sessionClose function

Post 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
Post Reply