scs Posted July 23, 2006 Share Posted July 23, 2006 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! Quote Link to comment Share on other sites More sharing options...
trq Posted July 24, 2006 Share Posted July 24, 2006 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 [i]site[/i] have to do with a p2p network?As for where to look. php's [url=http://php.net/sockets]socket[/url] is pretty standard. Not that far removed from what is available in vb.net really. Quote Link to comment Share on other sites More sharing options...
scs Posted July 24, 2006 Author Share Posted July 24, 2006 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 Quote Link to comment Share on other sites More sharing options...
trq Posted July 24, 2006 Share Posted July 24, 2006 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. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 24, 2006 Share Posted July 24, 2006 Your idear is a ftp server lol.................goto http://hotsripts.com Quote Link to comment Share on other sites More sharing options...
448191 Posted July 24, 2006 Share Posted July 24, 2006 [quote author=redarrow link=topic=101605.msg402321#msg402321 date=1153714933]Your idear is a ftp server lol.................goto http://hotsripts.com[/quote]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.phpServer 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.1Server 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? Quote Link to comment Share on other sites More sharing options...
scs Posted July 30, 2006 Author Share Posted July 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
trq Posted July 30, 2006 Share Posted July 30, 2006 [quote]How do I send information from php straight to a computer using it's ip[/quote]Using [url=http://php.net/sockets]sockets[/url]. Quote Link to comment Share on other sites More sharing options...
RShadow Posted July 30, 2006 Share Posted July 30, 2006 [quote author=thorpe link=topic=101605.msg402278#msg402278 date=1153704836]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.[/quote]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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.