Re: peer to peer messaging



Bond wrote:
Hi! I want to write an application that will send a message to another
computer using Sockets. I've wrote a simple echo client server before
using Sockets but this application is different. I want to be able to
send a message to any other computer running this application. *** The
problem that I'm running into is that when setting up the socket, if
the computer is hooked up in a network,

It would be a problem if the computer is *not* "hooked up" in a network. No network connection, no way to connect to it (ignoring the local loop for the moment). Was that sentence really meant as you wrote it?


I know the IP address of the
router...

Which router? Anyhow, routers are irrelevant when addressing a remote computer - the routers and the routing "just" has to be configured correctly in advance. You do not address a router directly when you want to connect to some computer behind that router. You still use an IP address for the computer, not for the router. If you have a name instead of an IP address, also fine. This will just require an additional DNS request to translate the name to the IP address of the computer - of course assuming that DNS for the computer has been set up correctly.



somehow I have to be able to send it directly to the
computer...

If there is no direct route, you simply can't. But that is not a problem. The job of a router is to route your packets to the intended destination by choosing an appropriate next hop. Why do you want to circumvent these helpful devices?


BTW: The first routing usually already happens inside your own computer. Your computer's routing table is consulted to decide which next hop should be used, and which physical interface.

how can I do this?  When a user uses the application, they
log in and if there is any information I can store on the server that
would help me do this, I can...   any help would be great. Thanks!

Which server? A central one? Didn't you say you want to implement a P2P application. What information? Storage?


I am usually flamed for the following advice, but I am used to it, so here it comes:

Please get a pen and paper and make up your mind what you really want. Sort your thought, sort out your terminology and read a textbook. You seem to be confused about how this whole IP networking thing works. A good introduction could help here. It is not only a good idea to know the basics when starting to design a networking application, but it is invaluable knowledge when you have to start to troubleshoot your application.

	Comer, Douglas E.: Internetworking with TCP/IP Vol 1.

or the late  W. R. Stevens'

	Stevens, W. R.: TCP/IP Illustrated, Vol.1 : The Protocols

come to mind. Any good library should have it, too.


/Thomas -- The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq .



Relevant Pages

  • Re: Plusnet 2Mbps connection
    ... There appears to be one network lead to each ... again with 4 output sockets. ... Only one of the Router ... >> computers and the other to a wall mounted wireless transmitter. ...
    (uk.people.silversurfers)
  • Re: Using Remote Desktop From an SBS Domain
    ... After I thought about needing 3389 forwarded on my router to allow me to ... Remote Desktop "out" from a workstation on my SBS network to a host XP ... Hopefully next week I can attempt a connection while my ISP watches the ...
    (microsoft.public.windows.server.sbs)
  • Re: Linksys NAS200 Network Storage adapter
    ... The only two wireless network settings that are of any consequence are the SSID and the encryption method and password. ... either click the "Print Network Settings" button on the final screen of the Wizard or simply access the appropriate XML file and get at them that way and then use the information to configure the router manually as I explained earlier. ... I've read thru some of the MS web site on that product and it appears to do everything a NAS will do plus other cool features, such as, with an xbox360 with the wireless adapter, I can stream my video/pics to my TV for family viewing. ...
    (microsoft.public.windowsxp.network_web)
  • Re: OSPF routes not in routing table
    ... Here's the output of "sh ip ospf database router", ... "(Link Data) Router Interface address: ... Link connected to: a Stub Network ... Number of TOS metrics: 0 ...
    (comp.dcom.sys.cisco)
  • Re: Host Computer with ICS cannot be accessed
    ... You read my mind on the router thing. ... My home network is a piece of cake... ... >>firewall settings, not that I've found so far, but I'll keep looking. ... and we couldn't get file sharing working until ...
    (microsoft.public.windowsxp.network_web)