|
-
Sep 5th, 2009, 04:48 PM
#1
Thread Starter
Member
Peer to Peer
Having started a thread here (http://www.vbforums.com/showthread.php?t=579689), it has been recommended that I use the System.Net.Sockets namespace for my application.
Basically, I want to create a simple chat application between 2 users but I also want the program to be able to send simple commands to the other user.
I have found lots of client/server examples of System.Net.Sockets namespace but nothing peer to peer.
Could anyone point me in the direction of a good tutorial or provide me with some code please?
Thanks
-
Sep 7th, 2009, 06:36 AM
#2
Re: Peer to Peer
 Originally Posted by 01chris
...but I also want the program to be able to send simple commands to the other user.
What do mean by "Simple commands", shall those Commands be directly be performed on the other system?
If they are limited in number, you could parse the incoming message for those commands and if a command is found, perform the command.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Sep 7th, 2009, 11:08 AM
#3
Thread Starter
Member
Re: Peer to Peer
 Originally Posted by opus
What do mean by "Simple commands", shall those Commands be directly be performed on the other system?
If they are limited in number, you could parse the incoming message for those commands and if a command is found, perform the command.
By simple commands I mean user 1 clicks a button on their pc, this is sent over the network and makes a messagebox appear on the screen of user 2.
I was thinking that I could parse the messages for commands but there's 2 issues with that:
1. I need to get the connection established in the first place (this is what I need lots of help with)
2. Although I have an idea of the thinking and logic behind parsing the messages for commands, I would like some help coding that.
Thanks Opus
-
Sep 7th, 2009, 02:33 PM
#4
Re: Peer to Peer
If I'm not wrong, for a peer-to-peer connection you need to run both client and server on both machines. And your router must also be configured to open you to the outside world (by default it is not).
http://www.vbforums.com/showthread.p...highlight=peer
-
Sep 8th, 2009, 12:41 AM
#5
Re: Peer to Peer
@01chris: This sounds like the existing DOS command "net send". Search for this one, its all in there already.
However, if you want learn programming something like that, start with establishing a connection first. And do it on a LAN first, the "outside" world would be the next step.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Sep 8th, 2009, 03:46 PM
#6
Thread Starter
Member
Re: Peer to Peer
Thanks Pradeep1210 and Opus.
I have been following Atheist's guide (http://www.vbforums.com/showthread.php?t=502795) and have got the server sending messages to the client and the client displaying them in a textbox but I cant get the other end working.
I want to send a string of text from the client to the server and then I want the server to display the message in a textbox. I have got the client sending the message but I cant make the server get the message from the network stream and then display it in the textbox.
How do I do this please?
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
|