Results 1 to 11 of 11

Thread: App to App connection

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Talking App to App connection

    I want to make a program where my app can communicate with my app on someone elses computer via the internet. What would I need to do this? Would I use tcp/ip to communcate or something else? How can I do this using VB .net 2005

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: App to App connection

    Yes you will have to use TCP/IP and well i am not to familiar with the VB 2K5 syntax as of yet but the basis is you will need to send data and retrieve it in the data_arrival event Also you will need to the client and server side in one

  3. #3

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: App to App connection

    do i need a server to be involved? Cant I directly connect to eachother?

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: App to App connection

    One will act as the client, the other the server. One will listen/accept connections (the server), while the other connects (client).

    In VB6, the best way to do this is using the Winsock control. You can use it in .NET but it's best to use the sockets class.

    I don't use .NET so I have no idea how. But I've seen code all over the net for it. A simple google search would probably bring up a lot of results.

    Look here:
    http://www.google.com/search?client=...=Google+Search

  5. #5
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: App to App connection

    xxarmoxx the application will need the server and client side in one. Because you wouldn't always want the user having to connect to a specific IP for the server.

  6. #6

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: App to App connection

    But just cause your calling one server and one client doesnt neccassarily mean I need to setup a machine as a server right? Just one peice of software 'acts' as a server and the other peice is the client. Is this correct? or do i need there to be a specified machine to be a server at all times?

  7. #7
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: App to App connection

    If it's just a 1on1 connection, you don't need a separate program to act as a dedicated server.

    Just put the server code into the same program. If they choose to act as a host, then it will listen for connections. If they want to act as a client then it will connect to the other computer.

  8. #8
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: App to App connection

    TCP is not the only option, don't forget there is UDP. Depends what the purpose is.

    Its definately not easy in .net, theres some samples at pscode.com.
    Chris

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: App to App connection

    Also be aware that, unless the two computers are on the same LAN, one or both of them may not be exposing their IP addresses. If a computer is behind a router, or a modem with a built-in router (or connected to a computer doing ICS), the router has to forward the listening port to the computer that's doing the listening (the "server").
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  10. #10
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: App to App connection

    One might also design the programs to "always listen" until a user clicks "connect." Then the clicked program would stop listening and attempt to connect to the other guy.

    I've looked at the TCP/IP socket support in .Net a little. It just gives me more respect for the good old Winsock control.

  11. #11
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: App to App connection

    .NET sockets are good but yes the good old winsock control is preferable.

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