![]() |
|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
StartFileDownload - service vs. client?
I'm trying to use StartFileDownload on a Sage server running in service mode. The code snippit below runs correctly on my SageClient but when I run it on my server (running in service mode) it fails.
Code:
try { status = Global.StartFileDownload("http://tmiranda.googlecode.com/files/JHM-Options.jpg", null, File.createTempFile("Test", ".tst")); if (status) System.out.println("**************WORKED"); else System.out.println("**************FAILED"); } catch (IOException e) { } ![]() I know the {} after the catch() is empty, but it's is not throwing any exceptions and I wanted to strip the test code down to the bare minimum to isolate the problem.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#2
|
|||
|
|||
I wonder if the default temp directory is not set when running for a service and is having some issue with creating the temp file. Have you tried using the version you can specify the directory and setting the path for the file?
Thanks, Jeff |
#3
|
||||
|
||||
The obvious first question is what login credentials does your service use and does it have permission to access the network? (LocalSystem does not.)
I would also add some debug code to print out the result of that call to File.createTempFile so you know exactly what arguments you're passing in. You said no execptions are thrown, but have you checked the log to see if any are being caught internally? Best policy is to debug with a console window open so you can see exceptions as they happen, without having to search through log files later.
__________________
-- Greg |
#4
|
||||
|
||||
Jeff, Greg,
I've checked the tempFile and that is being created property. I put some test code in before what I posted that checks to see if it's readable, checks for writable, and then writes something to it to make sure. I thought it was the tempFile so I pretty much beat that issue to death. I've got a console windows running, no exceptions that I can see. I had not considered the login credentials for the service. It is set to LocalSystem so that's probably the answer. Thank you.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#5
|
||||
|
||||
Thinking about this a little more - How can Sage download files if the service is logged in as LocalSystem? That StartFileDownload method is what Sage uses to download updates, online videos, and other things that are remote. How can Sage use it when the service is logged in as LocalSystem?
I'm thinking the issue may be related to that fact that I'm actually using StartFileDownload from a thread spawned by a servlet. Maybe that's the difference?
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
||||
|
||||
I don't think LocalSystem truly restricts network access, it restricts filesharing. Most services, even things like web servers and such, work fine in localsystem.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#7
|
||||
|
||||
Update. I never could get this to work so I wrote my own method to download files.
I had to write the new method anyway because Sage's method is not reentrant and you have to make sure only one thread accesses the method at any given time. Another day, another lesson learned.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mac Client Service | jpwegas | SageTV Mac Edition | 10 | 02-13-2010 12:03 PM |
Client lockup only when server is running service | pratt733 | SageTV Software | 4 | 04-21-2008 09:58 AM |
Converting from Client to Service Mode | jturner421 | SageTV Software | 2 | 12-22-2007 01:47 AM |
Running as service - client does not connect? | Skybolt | SageTV Software | 2 | 08-22-2006 11:47 AM |
Sage as a client while in Service mode | ptaylor | SageTV Software | 2 | 02-21-2006 05:18 PM |