The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > Omni Frameworks
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
OmniNetworking Problem Thread Tools Search this Thread Display Modes
Hello,

Disclaimer: it has been years since I tried programming for OS X the last time.

Now, I just cannot manage to get OmniNetworking working. The sample code in OmniNetworking/Examples/TCPTest/ compiles fine (after creating a new .xcodeproj, the .pbproj project file is reported to be incompatible with my App Store-purchased XCode). However, when running the resulting binary with the -receive flag and a port (over 1024), it throws an exception: ONHostHasNoAddressesExceptionName. I have nailed this down to ONHost.m line 333:

Code:
NSString *lowercaseHostname = [aHostname lowercaseString];
where aHostName suddenly has an invalid address... That variable was just fine before trying to find the host name it contained in the hostCache.

A smaller example that is non-working in the same way is:

Code:
#import <Foundation/Foundation.h>
#import <OmniBase/OmniBase.h>
#import <OmniNetworking/OmniNetworking.h>

int main (int argc, const char * argv[])
{

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSString *hostName;
    unsigned short hostPort;
    ONHost *host;
    
    hostName = [[NSString alloc] initWithString: [ONHost localHostname]];
    
    hostPort = 2357;

    host = [ONHost hostForHostname:hostName]; // exception thrown here
    if (![[host addresses] count]) {
        fprintf(stderr, "Cannot determine an address for %s\n", argv[2]);
        exit(1);
    }
    
    [hostName release];
    [pool drain];
    exit(0);
    return 0;
}
Can somebody help me out here? What am I doing wrong?

Last edited by tageborg; 2011-04-05 at 01:28 PM.. Reason: Wrong line number fixed.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maybe a bug in OmniNetworking beni46 Omni Frameworks 0 2009-04-30 12:24 AM
The Problem With GTD SpiralOcean OmniFocus 1 for Mac 29 2008-11-17 11:55 AM
OmniNetworking in Leopard malcom Omni Frameworks 0 2007-11-10 05:23 PM
OmniNetworking for mac intel issamneo Omni Frameworks 1 2007-01-25 07:05 AM
RSS 2.0 problem brentb OmniWeb Bug Reports 1 2006-05-20 10:48 AM


All times are GMT -8. The time now is 09:37 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.