Results 1 to 4 of 4

Thread: Question about client connecting with the server that is on deferent network sections

  1. #1
    WangChen is offline Registered User
    Name: Chen Wang
    Organization: JiaoTong University,Beijing,China
    Project: Network Management System
    Join Date
    Aug 2005
    Posts
    6

    Question about client connecting with the server that is on deferent network sections

    Hi,
    I did a test with the hello project in democs of IceCS-3.1.0. I put the client side on 192.168.10.230,win2000 and the server side on 192.168.6.233,win2003. As a result, it is very slow to connect with the server.
    I find some code in Network.cs of Ice project in IceCS-3.1.0 solution as follows:
    public static string getNumericHost(string hostname)
    {
    int retry = 5;

    repeatGetHostByName:
    string numericHost;
    try
    {
    #if ICE_DOTNET_1X
    numericHost = Dns.GetHostByName(hostname).AddressList[0].ToString();
    #else
    numericHost = Dns.GetHostEntry(hostname).AddressList[0].ToString();
    #endif
    }
    catch(Win32Exception ex)
    {
    if(ex.NativeErrorCode == WSATRY_AGAIN && --retry >= 0)
    {
    goto repeatGetHostByName;
    }
    Ice.DNSException e = new Ice.DNSException("address lookup failed", ex);
    e.host = hostname;
    throw e;
    }
    catch(System.Exception ex)
    {
    Ice.DNSException e = new Ice.DNSException("address lookup failed", ex);
    e.host = hostname;
    throw e;
    }
    return numericHost;
    }

    The reason for the problem is that when the client runs at "Dns.GetHostEntry(hostname).AddressList[0].ToString() " ,here hostname="192.168.6.233",it should wait for a while and then throws an Win32Exception about Host not found,No such host is known.

    The problem didn't come out when the client and server in the same section or with c++ client.

    what should I do for this?Could you help me how to solve this problem?Thanks.
    Last edited by WangChen; 10-11-2006 at 10:19 PM.
    WangChen
    Beijing Jiaotong University, P.R.China
    www.bjtu.edu.cn
    cwang82566@sohu.com

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Hmmm...

    This looks like some sort of DNS configuration problem. What exactly are you seeing? Does the client eventually connect successfully, and it's just slow, or does it get an exception?

    Could you run client and server with Ice.Trace.Network=3 and provide the output? Are you sure that your DNS is configured correctly? What happens when you run nslookup in a command shell and look up the same addresses?

    Sorry to ask all these questions, but I need a bit more info to work out what's going wrong.

    Cheers,

    Michi.

  3. #3
    WangChen is offline Registered User
    Name: Chen Wang
    Organization: JiaoTong University,Beijing,China
    Project: Network Management System
    Join Date
    Aug 2005
    Posts
    6
    Ok,it is just slow when the client connecting to the server,then it eventually connect successfully.And also it send data to the server very quickly.

    In the icecs.dll source code. It throw an exception at Network.cs

    catch(Win32Exception ex)
    {
    if(ex.NativeErrorCode == WSATRY_AGAIN && --retry >= 0)
    {
    goto repeatGetHostByName;
    }
    Ice.DNSException e = new Ice.DNSException("address lookup failed", ex);
    e.host = hostname;
    throw e;
    }



    I set Ice.Trace.Network=3
    but there is nothing output before throw Ice.DNSException.
    When the client have connected the server ,the output is:

    [ client.exe: Network: trying to establish tcp connection to 192.168.6.233:10000
    ]
    [ client.exe: Network: tcp connection established
    local address = 192.168.10.230:2179
    remote address = 192.168.6.233:10000 ]
    [ client.exe: Network: received 14 of 14 bytes via tcp
    local address = 192.168.10.230:2179
    remote address = 192.168.6.233:10000 ]
    [ client.exe: Protocol: received validate connection
    message type = 3 (validate connection)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 14 ]
    [ client.exe: Protocol: sending request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 56
    request id = 1
    identity = hello
    facet =
    operation = ice_isA
    mode = 1 (nonmutating)
    context = ]
    [ client.exe: Network: sent 56 of 56 bytes via tcp
    local address = 192.168.10.230:2179
    remote address = 192.168.6.233:10000 ]
    [ client.exe: Network: received 14 of 14 bytes via tcp
    local address = 192.168.10.230:2179
    remote address = 192.168.6.233:10000 ]
    [ client.exe: Network: received 12 of 12 bytes via tcp
    local address = 192.168.10.230:2179
    remote address = 192.168.6.233:10000 ]
    [ client.exe: Protocol: received reply
    message type = 2 (reply)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 26
    request id = 1
    reply status = 0 (ok) ]
    usage:
    t: send greeting as twoway
    o: send greeting as oneway
    O: send greeting as batch oneway
    d: send greeting as datagram
    D: send greeting as batch datagram
    f: flush all batch requests
    T: set a timeout
    S: switch secure mode on/off
    s: shutdown server
    x: exit
    ?: help

    ==>



    I run nslookup in cmd and then the output is
    Default Server: dialdns.bta.net.cn
    Address: 202.106.46.151


    I config two dns which are 202.106.46.151 and 202.106.0.20

    Thanks.
    Last edited by WangChen; 10-12-2006 at 02:05 AM.
    WangChen
    Beijing Jiaotong University, P.R.China
    www.bjtu.edu.cn
    cwang82566@sohu.com

  4. #4
    WangChen is offline Registered User
    Name: Chen Wang
    Organization: JiaoTong University,Beijing,China
    Project: Network Management System
    Join Date
    Aug 2005
    Posts
    6
    The client.cs of hello project in democs.

    It is just slow when the client run at this code :

    HelloPrx twoway = HelloPrxHelper.checkedCast(
    communicator().stringToProxy(proxy).ice_twoway().i ce_timeout(-1).ice_secure(false));


    because of it throws Ice.DNSException.

    However, it doesn't occur in c++ demo at the same code.
    HelloPrx twoway = HelloPrx::checkedCast(
    communicator()->stringToProxy(proxy)->ice_twoway()->ice_timeout(-1)->ice_secure(false));


    Thanks.
    Last edited by WangChen; 10-12-2006 at 02:58 AM.
    WangChen
    Beijing Jiaotong University, P.R.China
    www.bjtu.edu.cn
    cwang82566@sohu.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2006, 02:17 AM
  2. one question: c# is client, c++ is server
    By tianfu in forum Help Center
    Replies: 1
    Last Post: 11-16-2005, 04:07 AM
  3. Client connecting to multiple glacier2 routers
    By feline in forum Help Center
    Replies: 1
    Last Post: 04-21-2005, 05:11 AM
  4. Replies: 1
    Last Post: 03-24-2005, 04:57 AM
  5. Ice Client server question?
    By frostzero in forum Help Center
    Replies: 2
    Last Post: 04-27-2004, 05:02 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
  •