Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file
Multiple instances accessing an FTP file Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Go Back  Xtreme Visual Basic Talk > > > Multiple instances accessing an FTP file


Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2012, 12:58 PM
pampam686 pampam686 is offline
Freshman
 
Join Date: Nov 2010
Posts: 33
Default Multiple instances accessing an FTP file


I'm using ftp.drivehq.com to store player data/info for an online game i'm developing. i don't know how to use mysql so i just put the playerinfo and items info on the ftp server as .txt files.

Now, i made a feature in the game which allows players to trade items. I'm just using this simple code for that:

My.Computer.Network.DownloadFile(ftpFileName, downloadTO, "xxxxx", "xxxx") and its upload equivalent for transactions.

My problem is, whenever multiple applications "BUY" the posted item at the "Bazaar" the item can be received by those 'clients'.

What can i do to prevent this? Since there is a lag there isn't enough time for the first buying client to delete the posted item immediately and this causes item duplication.
Reply With Quote
  #2  
Old 08-24-2012, 02:22 AM
DrPunk's Avatar
DrPunkMultiple instances accessing an FTP file DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

Could you not associate the client with the filename?

Presumably there is some way of identifying the client? If so you could put the client name in the filename when it buys the item, and when it goes to download it it uses its client name to get the file. Clients can therefore only access files they have bought.
__________________
There are no computers in heaven!
Reply With Quote
  #3  
Old 08-26-2012, 07:09 AM
pampam686 pampam686 is offline
Freshman
 
Join Date: Nov 2010
Posts: 33
Default

sorry i dont really understand. can you please explain further what i really need to do
Reply With Quote
  #4  
Old 08-26-2012, 07:52 AM
PlausiblyDamp's Avatar
PlausiblyDampMultiple instances accessing an FTP file PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Are these files only supposed to be accessed by a single user at a time? If so then I doubt ftp is going to work in this case as it doesn't provide any mechanism to lock files or restrict access to a single user.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #5  
Old 08-26-2012, 08:35 AM
AtmaWeapon's Avatar
AtmaWeaponMultiple instances accessing an FTP file AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

I think you're asking the impossible. You could come up with some kind of locking system where you create/delete new files to represent transactions, but because of latency a foolproof system would take a /lot/ of experience and elbow grease. Many databases handle this problem; the next-best solution would be a server-side program that handles requests.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
 
Multiple instances accessing an FTP file
Multiple instances accessing an FTP file
 
-->