Author Topic: Does tnet read .txt files directly from server?  (Read 108 times)

acronyte

  • Newbie
  • *
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 43
    • View Profile
Does tnet read .txt files directly from server?
« on: November 22, 2017, 07:34:22 AM »
I'm using
  1. TNManager.LoadFile("filename.txt", OnLoadFile);
....for loading data from this file on my server..

What i'd like to know is, Does tnet:
 - read data directly from this file on the server?
 - or does it download the entire file (on start), then read it locally?

I am asking because, the file size will increase over time and concerned on the time taken to read the data...

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 144
  • Posts: 269
  • TNet Alchemist
    • View Profile
Re: Does tnet read .txt files directly from server?
« Reply #1 on: November 22, 2017, 10:10:53 PM »
Don't entirely understand your questions, but each call to TNManager.LoadFile will result in the entire file being sent from the server to the client.
However, on the server, the file is cached so not every call results in file I/O. Calls to SaveFile will update the cache, too, as expected. Client does not cache files.

If you want delta updates you could implement all this behaviour with RFCs instead.

acronyte

  • Newbie
  • *
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 43
    • View Profile
Re: Does tnet read .txt files directly from server?
« Reply #2 on: November 23, 2017, 05:34:40 AM »
but each call to TNManager.LoadFile will result in the entire file being sent from the server to the client.

This is basically what I wanted to know. thank you.