Results 1 to 6 of 6

Thread: how to send messages from server to client initiatively?

  1. #1
    fw_csha is offline Registered User
    Join Date
    Sep 2004
    Posts
    22

    how to send messages from server to client initiatively?

    my application will be used in that environment:
    the server has a real ip,
    but the client may be in a LAN , the client doesn't have a real ip ,it connects to WAN
    through NAT.

    just like a chat software, or other p2p software,
    the server has to send messages to client initiatively and continuously.
    (that means the server will send messages .At the same time ,the client will accept those messages like a server.)

    if i use socket to write my code , i just need use send ,
    then, although the client in a LAN ,i can connect to it ,and send messages initiatively.

    but now ,i can't get the client 's ip and port in ICE.
    how to do when i have to send messages to a client which is in a LAN and don't have a real ip ?
    i need the server sends messages initiatively.
    is there any example which can let me study?

    I have searched the forum .
    suggested by the ZEROC'S STAFF is to build client as a server ,
    that applies to ones which have real ip ,but my client don't have a real ip .



    the actions what i need :
    1.server starts
    2.client connects to server
    3.server sends messages to client initiatively and continuously.

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Quote Originally Posted by fw_csha
    my application will be used in that environment:
    the server has a real ip,
    but the client may be in a LAN , the client doesn't have a real ip ,it connects to WAN
    through NAT.
    ...
    the actions what i need :
    1.server starts
    2.client connects to server
    3.server sends messages to client initiatively and continuously.
    You have to use a bidirectional connection. You can do this through Glacier2 or directly. For Glacier2 demos see demo/Glacier2. For a direct bidir demo see demo/Ice/bidir.

    Best Regards, Matthew

  3. #3
    autofish is offline Registered User
    Join Date
    Apr 2006
    Posts
    4

    Smile How can I make a P2P application?

    I had research the bidir example and glacier2callback example. But the example case is not the P2P network environment. I want to make a P2P chat program, the program instance connects to another program instance throught the server has the real ip! How can I do it. Somebody can give example code?

  4. #4
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Please don't post the same question twice.

  5. #5
    Jim.Han is offline Registered User
    Name: Austin
    Organization: Sunrisetelecom
    Project: net game
    Join Date
    Apr 2006
    Location
    china
    Posts
    3
    p2p examples?

    look this:
    http://p2p.tmn.cn/

  6. #6
    albertods is offline Registered User
    Name: Alberto Della Santina
    Organization: University of Pisa - department of IT Engineering
    Project: Mobile remote controller
    Join Date
    Feb 2006
    Location
    Pisa (Italy)
    Posts
    58

    p2p examples

    I was pretty interested in those examples, but unfortunately I don't know chinese: neither me nor my browser is compatible

    Could you post another link, possibly in english?


    Thanks



    Alberto
    Last edited by albertods; 06-22-2006 at 05:13 AM.
    Alberto Della Santina
    IT Engineering Department
    University of Pisa (Italy)
    www.ing.unipi.it
    www.iet.unipi.it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 08-15-2007, 02:08 AM
  2. send an object client -> server
    By arnaud in forum Help Center
    Replies: 3
    Last Post: 02-23-2006, 07:29 PM
  3. how can i make server send string to client
    By jerry_cym in forum Help Center
    Replies: 2
    Last Post: 02-07-2006, 04:46 AM
  4. Replies: 3
    Last Post: 11-26-2004, 09:35 AM
  5. How to send data from server to client?
    By kane in forum Help Center
    Replies: 4
    Last Post: 10-26-2004, 08:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •