[BitTorrent] How to control a background job
bill at viasic.com
Wed Jan 12 10:19:40 EST 2005
I could use some advice on the best way to control a background job.
The interface to the job has two goals: first, to allow for text based
control; second to allow a simple interface that nicer GUI could drive
(which I don't intend to write). What's the best way to do it?
The job I'd like to conntrol is btslave, a BT client that typically will
run in the background. It's primary job is helping your normal BT
client download faster (as a slave repeater). It needs to be told when
to join a torrent, or it wont know that you're downloading. Right now,
I kill the job, and restart it with the torrent file name on the command
Several options come to mind:
I could just parse user commands from the command line, like ftp.
However, as a demon running in the background, I don't know how to get
access to stdin and stdout. I could also use a config file, and send a
SIGHUP signal to btslave to have it re-read it. That's not very user
friendly. I could support a telnet port, and get access to a command
line interface that way. I could support a ssh connection directly to
btslave. Is this hard? Portable? I could provide an http interface,
the way swat does. That's a lot of work. I could support a command
line interface, but enable one copy of btslave to control another over a
There are other permutations. How would you guys do it?
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
BitTorrent-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the BitTorrent