applet to applet communication over lan

Discussion in 'Java' started by Jade, Aug 14, 2003.

  1. Jade

    Jade Guest

    is it possible to make 2 applets communicate from 2 seperate pc's over
    a lan without a server? they are loaded from the same html file on a
    network drive for both pc's. i am a java newbie, so please go easy on
    me ;) an example would be nice if possible
    Jade, Aug 14, 2003
    #1
    1. Advertising

  2. Jade

    Roedy Green Guest

    On 14 Aug 2003 03:59:27 -0700, (Jade) wrote or
    quoted :

    >is it possible to make 2 applets communicate from 2 seperate pc's over
    >a lan without a server? they are loaded from the same html file on a
    >network drive for both pc's. i am a java newbie, so please go easy on
    >me ;) an example would be nice if possible


    Yes, but they must be signed. One has to open a server socket, the
    other a client socket. Then they can pump data back and forth.
    Alternatively they could send UDP datagrams at each other.
    see http://mindprod.com/fileio.html for how to do the client side
    socket. See Marty Hall's book for how to do the server side. See
    http://mindprod.com/jgloss/cgi.html


    One problem is finding each other. The client needs to know the DNS
    name or the IP of the server. You might use DYNDNS for this. See
    http://mindprod.com/jgloss/dyndns.html


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Aug 14, 2003
    #2
    1. Advertising

  3. Jade

    J Skaggs Guest

    > Yes, but they must be signed. One has to open a server socket, the
    > other a client socket. Then they can pump data back and forth.


    Is there any resources on the web that describe how to do this?
    J Skaggs, Aug 14, 2003
    #3
  4. Jade

    Roedy Green Guest

    On Thu, 14 Aug 2003 11:37:15 GMT, Roedy Green <>
    wrote or quoted :

    >One problem is finding each other. The client needs to know the DNS
    >name or the IP of the server. You might use DYNDNS for this. See
    >http://mindprod.com/jgloss/dyndns.html



    Let's say this is a chat application. What you could do is have a
    simple chat server. It does not relay messages. All it does it tell
    everyone participating in a given chatroom everyone else's IP number.
    So every time somebody joins, everyone's applet in that chatroom gets
    a message. From then on speakers send multiple copies of the message
    to all other chatroom participants, offloading the server. They could
    use UDP with everyone listening on the same port. You may lose a
    message every now and then, but that would not be critical for chat.
    The ability to run a huge chatroom on a dinky server makes up for it.
    All it has to do is track which participants are in which chatrooms.

    You can prune the traffic back even further by having participants
    automatically notify the others when they enter or leave. You could
    have a "gc" sweep every once in a while to notify everyone of the
    participants to help correct for lost messages.


    The disadvantage of this scheme is less anonymity. A hacker could
    harvest ip addresses of participants.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Aug 14, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bress
    Replies:
    0
    Views:
    470
    Daniel Bress
    Sep 15, 2003
  2. prabhu
    Replies:
    5
    Views:
    577
    Roedy Green
    Mar 25, 2006
  3. n00m
    Replies:
    33
    Views:
    962
    Bryan Olson
    Sep 9, 2005
  4. =?Utf-8?B?R3JlZ09yb2FtaW4=?=

    Cannot open asp.Net 1.1 page over LAN after .Net 2 installed

    =?Utf-8?B?R3JlZ09yb2FtaW4=?=, Feb 21, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    395
    =?Utf-8?B?R3JlZ09yb2FtaW4=?=
    Feb 21, 2007
  5. Astan Chee

    copy file over LAN

    Astan Chee, Mar 27, 2008, in forum: Python
    Replies:
    2
    Views:
    364
Loading...

Share This Page