Home Help Center

TCP works but UDP doesn't

catalincatalin Member ✭✭
Hi!

#using Ice-1.4.0 on FC2

I have a set of a simple client and server programs. I specify the protocol to be used and the port number on the command line, like this:

./serverP "tcp -p 10000" , and
./clientP "tcp -p 10000"

From my client I make a call to a servant which returns a sequence of bytes. This works fine when I use the TCP protocol as shown above, but not if I try to use the UDP protocol, like this:

./serverP "udp -p 10000" , and
./clientP "udp -p 10000"

When specifying the UDP protocol, the initialization works well, but when the call is executed I get the following:

Reference.cpp:711: Ice::NoEndpointException:
no suitable endpoint available for proxy `PolledWebCam -t:udp -v 1.0 -e 1.0 -h 127.0.0.1 -p 10000'


So I wonder wheater the syntax for specifying the UDP protocol is different from the one used to specify the TCP protocol (but since the initialization works out, I guess it is not). I also wonder what would happen if my call would return a sequence of byted of size, say 100KB. Since a UDP datagram is limited at 65KB, will ICE fragment the reply on the server side and reassemble it on the client side behind the scenes, or do I have to include that in the logic of my program? If ICE does fragment such a long reply, will it monitor the arrival of the fragments and retransmit those which happen to get lost? I am thinking that if ICE does that, then using UDP with ICE is almost like using TCP.

I tried to make such a call which I hardcoded to return a sequence of bytes of length 30, which is peanuts, but this NoEndpointException still occurs, so I guess the length of the replies is an issue I will probably be running into later.

Thanks if you can help,
Catalin

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Re: TCP works but UDP doesn't
    Originally posted by catalin

    Reference.cpp:711: Ice::NoEndpointException:
    no suitable endpoint available for proxy `PolledWebCam -t:udp -v 1.0 -e 1.0 -h 127.0.0.1 -p 10000'


    The error message shows the proxy set to twoway mode ("-t"), but only a UDP endpoint is available. Thus you get an error message about no suitable endpoint being found. You must set the proxy to datagram, like this:

    Ice::ObjectPrx proxy = ...
    proxy = proxy->ice_datagram();
  • catalincatalin Member ✭✭
    Hmm, chapter 16 of the documentation of some older version of ICE (1.2.0 ?) "The Ice Run Time in Detail", throws some interesting light on the issue at hand. Since my invocation returns something (else then void), it seems to me that I do not have the luxury to choose UDP at start up, as only stream protocols can do what I want.

    I reckon this has not changed in later versions of Ice. So I guess I will have to use plan B :D

    Catalin
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Correct, datagrams cannot have any return or out value, or user exception, just like oneways.
Sign In or Register to comment.