Results 1 to 6 of 6

Thread: Peer to Peer

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    48

    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

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Peer to Peer

    Quote Originally Posted by 01chris View Post
    ...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!

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    48

    Re: Peer to Peer

    Quote Originally Posted by opus View Post
    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

  4. #4
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    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
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    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!

  6. #6

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    48

    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
  •  



Click Here to Expand Forum to Full Width