|
-
May 15th, 2007, 07:53 PM
#1
Thread Starter
Hyperactive Member
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
-
May 15th, 2007, 10:51 PM
#2
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
-
May 16th, 2007, 12:41 AM
#3
Thread Starter
Hyperactive Member
Re: App to App connection
do i need a server to be involved? Cant I directly connect to eachother?
-
May 16th, 2007, 12:46 AM
#4
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
-
May 16th, 2007, 04:45 AM
#5
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.
-
May 16th, 2007, 01:10 PM
#6
Thread Starter
Hyperactive Member
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?
-
May 16th, 2007, 01:39 PM
#7
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.
-
May 17th, 2007, 03:22 AM
#8
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.
-
May 18th, 2007, 04:47 PM
#9
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
-
May 20th, 2007, 09:34 AM
#10
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.
-
May 21st, 2007, 06:50 AM
#11
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|