|
-
Dec 2nd, 2002, 03:47 PM
#1
Thread Starter
Addicted Member
File Sharing Help Needed
O.K. Say i have a database on the web and everytime someone uses my software their ip address is loged and also every file in their shared folder called 'Afiles' and then someone searches the database for a file and gets a list of people with that file and the software has the ip's of the people. Now i am stuck could someone give me some example code as to how i could connect to the ip and download the file. Also if i had say over 1,000,000 people using the software what type of database would i need.... would an access database like on a home pc work...if not how many things can an access database do at once?
Thanks for your help!
-
Dec 2nd, 2002, 03:55 PM
#2
Frenzied Member
I dont think you'll be able to download the file unless the users have it shared.
Last edited by DevGrp; Dec 2nd, 2002 at 10:28 PM.
Dont gain the world and lose your soul
-
Dec 2nd, 2002, 10:16 PM
#3
New Member
First of all, you just can't download a file from another person's computer, they have to send it to you, you can only ask them to do it. That means you must have a client program running on both computers (unless you plan on doing this using ftp but then every user would have to have an ftp server set up).
I found the easiest way to send files of any type is to have a stream read bytes from the file and put it into a buffer. When the buffer is full (say 1024 bytes) send it across the network stream. Keep doing this until the stream reader throws an end of stream exception. I did this and it worked fairly well. I was able to send a file of a rate of about 700KBs.
I suggest using msdn to look into sockets, streams, and files. That's how I learned it all.
-
Dec 4th, 2002, 12:05 PM
#4
Thread Starter
Addicted Member
ok so you would do it like this then....send the client program a request for a file along with that request would be your ip adress if the person was letting people get files from their computer then their client program would use the ip that was recieved then conect to my pc and send me a file...would my client program have to be waiting to recieve the file or does it just download it automatically? Thanks for your info!
-
Dec 4th, 2002, 03:03 PM
#5
PowerPoster
Also if i had say over 1,000,000 people using the software what type of database would i need.... would an access database like on a home pc work...if not how many things can an access database do at once?
Are they all using it at the same time? If so, you are going to need to invest in some serious bandwidth and servers.
You are probably not going to want to use Access. Think about it. You are going to have to store 1,000,000 peoples files (not the file, just the names). Say each person has only 10 files to share, that means you are now tracking 10,000,000 files on the network. See how easy it would be to break Access's back with that? Plus your response times would be REALLY slow compared to SQL Server or an Oracle DB. I would suggest a bigger enterprise grade DB if you are doing that much volume. I would also use stored procedures and such that Access just doesn't offer you.
I am thinking though that you are just starting out, and won't have a 1,000,000 people all at once. Since this is probably the case, I would start with an Access database because it is an affordable solution. Just keep in mind when your developing the app that you might have to scale up to a different database sometime, and configure your code accordingly.
You can also use a MySQL database. I think it is free. I haven't used it but I have heard that it can compete with some of the more expensive databases like MS's SQL Server and Oracle. You might want to check into it.
-
Dec 4th, 2002, 03:15 PM
#6
Thread Starter
Addicted Member
about how much bandwidth do you guess it would take to handle the kind of traffic say Kazaa has....I guess my question is...If the Code was great code and it put minimal strain on the servers running it, what is a guesstimate on how many servers would be needed and how much it would cost for the bandwidth?
Also how much is an Oracle DB? Do you buy one at a set cost or do you have to pay monthly on it? Thanks!
-
Dec 4th, 2002, 03:32 PM
#7
Thread Starter
Addicted Member
another question
O.K. say each client program had its own access database distributed along with it and you had a central server with only a couple of ip's of Volunteer servers(like someone with a dsl connection or something) and when a client logs in they are directed from the central server to one of the volunteer servers...these volunteer servers have the ip's of everyone who was directed to that particular volunteer server in the order that they were logged on and each new client is connected to the last ip address to form a type of chain as follows:
(1)-(2)-(3)-(4)-ect....
each time a user was connected the information in the previous users DB would be transfered to the new client in the order of something like this
user ip and a list of his/her files
next user ip and a list of files
next ...
next....
and so on
and the people toward the front of the line could querry the volunteer server for the guy at the end of the line so they could request a updated list of ip's & files.
Is this model of a P2P network doable on a large scale of 1,000,000?
Oh yea one more thing as a user logs off his/her client software would redirect the users who are connected to this user to the newest user...this would be to keep everything from collapsing when a user logs off.
is it doable?
Thanks for your help!!
-
Dec 4th, 2002, 03:38 PM
#8
yay gay
man it is doable but dunno if it is worth...
\m/  \m/
-
Dec 4th, 2002, 03:41 PM
#9
yay gay
also, the server to 1000000 ppl wouldnt be a 56kb would it?
\m/  \m/
-
Dec 4th, 2002, 03:48 PM
#10
Thread Starter
Addicted Member
also, the server to 1000000 ppl wouldnt be a 56kb would it?
what do you mean?
56kb? you mean from the server to the dial ups...yea
does that mean 1000000 x 56kb....o do not think i understand you question?
-
Dec 5th, 2002, 02:05 AM
#11
PowerPoster
Originally posted by Buy2easy.com
about how much bandwidth do you guess it would take to handle the kind of traffic say Kazaa has....I guess my question is...If the Code was great code and it put minimal strain on the servers running it, what is a guesstimate on how many servers would be needed and how much it would cost for the bandwidth?
Also how much is an Oracle DB? Do you buy one at a set cost or do you have to pay monthly on it? Thanks!
You would have to figure out bandwidth requirements after you decide what traffic is going to be taking place between the clients and servers. Lets say that each person transfers 25K an hour to the server and back. Multiply that by 1,000,000 (or the number of people you expect to be on at one time). That is how much traffic you have per hour. Divide that by 3600 (seconds in a hour) and you come up with 6944K every second. That is the perfect situation. You could only wish for a constant 6944K every second, but it doesn't work like that. Sometimes all the users will be transfering at the same time. You would have to build in a lot of head room. At the bare minimum, you would want something that can handle 138888K a second (multiplied the ideal number 6944 by 10). That is HUGE!!! Plus you need the server power to handle all that at one time.
You could off load some of the bandwidth to other servers, this is done a lot. I just don't know the details of such things, it is way beyond me....
Oracle for a DB is pretty expensive. I am sure it is somewhere near MS's SQL Server or higher. I think you only pay for connection license. I think MS's SQL Server's ten connection license is over 1,000 dollars. This means that only 10 connections can be made to the database at one time. (You would use middle ware components to round robin the connection requests between the 10 you pay for). Of course, you can buy more if you need them.
You have gone way past my knowledge on this project. I hope you can get more accurate information from others. Are you sure your going to be having 1,000,000 people on at the same time? You might want to look at the Gnutella network, I thought I saw someone had the source code to one of their projects.
-
Dec 5th, 2002, 10:10 AM
#12
Thread Starter
Addicted Member
Gnutella network? I think i have heard of it but i do not know what it does could someone explain it to me or give me a link to explain it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|