Professional Web Applications Themes

OTConnect error -3167 - Mac Programming

Hi, I'm trying to connect to a local server (128.0.0.1) using Open Transport lib on my eMac (OS X 10.3 Panther). The code comes from the same app in MacOS 9 in which it works very well. When I use it in my OS X app (after using new Carbon calls such as OTAsyncOpenEndpointInContext instead of OTAsyncOpenEndpoint) it returns with code -3167 kOTNotSupportedErr i.e. Command not supported! What does this error means? The trouble is I manage to first connect to the same server using OTBind and OTSndUData to retreive its real address and port number (1969 in my case) ...

  1. #1

    Default OTConnect error -3167

    Hi,

    I'm trying to connect to a local server (128.0.0.1) using Open
    Transport lib on my eMac (OS X 10.3 Panther).
    The code comes from the same app in MacOS 9 in which it works very
    well.
    When I use it in my OS X app (after using new Carbon calls such as
    OTAsyncOpenEndpointInContext instead of OTAsyncOpenEndpoint) it
    returns with code -3167 kOTNotSupportedErr i.e. Command not supported!
    What does this error means?

    The trouble is I manage to first connect to the same server using
    OTBind and OTSndUData to retreive its real address and port number
    (1969 in my case) and everything goes well.
    Even after OTUnbinding from this call, the call with OTConnect fails.
    Here is (part of) the code:

    TCall sndCall;
    memset(&sndCall, 0, sizeof(TCall));
    DNSAddress hostDNSAddress;
    sndCall.addr.buf = (UInt8*)&hostDNSAddress;
    sndCall.addr.len = OTInitDNSAddress(&hostDNSAddress, "128.0.0.1");
    err = OTConnect(gEndPoint, &sndCall, NULL);

    and err equals -3167...

    Same result with this code:

    TCall sndCall;
    memset(&sndCall, 0, sizeof(TCall));
    InetAddress inetAddress;
    // with UINT gServerPort = 1969
    // and InetHost gServerHost
    OTInitInetAddress(&inetAddress, gServerPort, gServerHost)
    sndCall.addr.buf = (UInt8*)&inetAddress;
    sndCall.addr.len = sizeof(InetAddress);
    err = OTConnect(gEndPoint, &sndCall, NULL);

    Any ideas?
    Does anyone already have encountered this error code?

    Thanks in advance for your help :-)
    MacPorter Guest

  2. #2

    Default Re: OTConnect error -3167

    In article <google.com>,
    com (MacPorter) wrote:
     

    You probably mean 127.0.0.1.

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  3. #3

    Default Re: OTConnect error -3167

    MacPorter wrote: 

    my first guess was that this is a typo, but then later on we've got
    example source code:
     

    dewd. the loopback address is 127.0.0.1

    see, this is why berkeley sockets gives you nice defines like
    INADDR_LOOPBACK, and why you should always, always use them.
    Jhnny Guest

  4. #4

    Default Re: OTConnect error -3167

    Hi,

    thanks for the answers.

    128.0.0.1 is the true IP address: I'm trying to connect to the local
    network server which IP address is 128.0.0.1, not to my own machine in
    loopback :-)

    Nevermind, my problem is solved:

    I have two calls to OTAsyncOpenEndpointInContext, one to locate the
    server and get its IP address (which should be 128.0.0.1) and its
    communication port (which should be 1969) and the other to establish
    the real connection.
    The first call uses OTCreateConfiguration(kUDPName) i.e. using UDP.
    I just copy and paste this line for the second call: but this second
    call must use OTCreateConfiguration(kTCPName) i.e. using TCP as it was
    doing in Mac OS 9 code.

    That's why OTConnect refused the command! :-)

    Again, thanks for your response.

    Jhnny Fvrt (it means "halo, then resonate") <com> wrote in message news:<nashville.comcast.net>... 
    >
    > my first guess was that this is a typo, but then later on we've got
    > example source code:

    >
    > dewd. the loopback address is 127.0.0.1
    >
    > see, this is why berkeley sockets gives you nice defines like
    > INADDR_LOOPBACK, and why you should always, always use them.[/ref]
    MacPorter Guest

Similar Threads

  1. Replies: 0
    Last Post: March 29th, 09:49 PM
  2. Replies: 0
    Last Post: November 10th, 05:24 PM
  3. Replies: 0
    Last Post: September 25th, 03:23 AM
  4. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139