Jump to content


Photo

p2p


  • Please log in to reply
8 replies to this topic

#1 scs

scs
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts
  • LocationUSA

Posted 23 July 2006 - 11:52 PM

I'm creating p2p software with vb.net. Well I need my web site to hold users information, and to send and receive information to the connected users. Well for the most part I know how to do that. The only thing I don't know how to do is sent information to a specific computer. I will most likely get the ip address when the computer sends information to the site. Does anyone know how to do this? I never messed around with networking in php yet. Any good tutorials would be appreciated.
Thanks in advance!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 July 2006 - 01:00 AM

Are you talking about building a server in php? I meen do you need to respond to requests or are you just going to send data out at regular intervals? How will you know your clients are still online?

Sorry... but you'll need to be a bit more detailed in exactly what it is your wanting to do. What exactly does the site have to do with a p2p network?

As for where to look. php's socket is pretty standard. Not that far removed from what is available in vb.net really.

#3 scs

scs
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts
  • LocationUSA

Posted 24 July 2006 - 01:28 AM

well here is what i'm planing.
Since my computer isn't fastest enough yet, so I can't use it as a my server. Which would be better than what I'm trying to do. Cause if I did I could have a program stay running to monitor things like connection. So for now I'll wont worry about that.
When someone opens the program it will submit information to a php page which will write to the database user information/ip address and time and all that needed stuff. When someone else connects (sort of speak) and sends information, message/file/whatever, I need a small script that with the ip address continue the information on. Now as regards to still connected. When the program closes it will submit to the page to eliminate the online status. When the user sends information to the user but the user closed the program then the php script should sent back to the other user that the user is off line.
I know thats cheesy. But it's something to work on until I get my new computer in almost 2 months. But even if I use my computer as the server I think I still maybe need to use php. I'm still researching it. so please give as much knowledge as you have on this subject.
Thanks

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 July 2006 - 01:33 AM

p2p is a client / server operation. Im still not sure what your question really is. In p2p, the actual files dont (usually) pass through a central server. Each user runs a client / server on there own machine. They then pass the files directly to each other.

A central server is really only used for search purposes.

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 July 2006 - 04:22 AM

Your idear is a ftp server lol.................

goto http://hotsripts.com
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 24 July 2006 - 05:56 AM

Your idear is a ftp server lol.................

goto http://hotsripts.com


No it's not. It's a p2p program. He's talking about transferring information to and from the server, not files. His idea is more like the old napster network, or the current bittorent network. You can even compare it to the DC++ network.

P.S. Please refrain from using "lol................." in everything you post. It's annoying as hell.

T.S.: Some tips:
1) Hash files client-side. Always nice to know you're talking about the same file.
2) Chunck files. You could refer by their hash and number: "3fec1dc9cce4b7fe7f64329da82bffe2.1"
3) On first connection of a peer within a session you probably have a lot of info to transfer: what chunks are available, what filenames, what adress is the client available at, etc. Have the server down a file from the peer.

Peer opens url: tracker.php
Server starts a session, stores ip and fetches file from peer.
Peer requests tracker.php?search=string%20to%20search.
Server returns file with search results.
Peer requests chunks. Server returns a file with appropiate adresses of other peers.
Peer does transactions with other peers.
Peer completes the donloading of chunks, requests tracker.php?add=3fec1dc9cce4b7fe7f64329da82bffe2.1
Server adds chunk to record of available chunks for this peer within this session.
Peer closes down, but first requests tracker.php?endsession.
Server destroys session data.

You do realize you're getting into a lot a lot of work, I hope?

#7 scs

scs
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts
  • LocationUSA

Posted 30 July 2006 - 05:08 AM

Thanks for the replys.

Well I know that's alot of work. I don't plan to have this done right away. I might not even finish it cause I'm getting a new computer which may be able to handle being a server. But it's good to know how to do this for future reference.

So one question that wasn't answered. How do I send information from php straight to a computer using it's ip. Everything else is really easy. Thats one of my main problems right now.

Thanks in advance.

#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 30 July 2006 - 06:13 AM

How do I send information from php straight to a computer using it's ip

Using sockets.

#9 RShadow

RShadow
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 30 July 2006 - 07:12 AM

p2p is a client / server operation. Im still not sure what your question really is. In p2p, the actual files dont (usually) pass through a central server. Each user runs a client / server on there own machine. They then pass the files directly to each other.

A central server is really only used for search purposes.

I hope you mean p2p is not a client / server operation.. p2p is a peer to peer model.. client server is a client and server model, they are very different.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users