Hi all,

I have a basic(for most of you) question.
I´m trying to make a very simple app that will have 1 button (for example) and when its pushed the app will create a socket connection with a host and will send it a message(command).

So , i used this:

- (IBAction)reset:(id)sender
{
    [textField setStringValue:@"Testing Socket"];
        
        
        
        NSString *urlStr = [sender stringValue];
    if (![urlStr isEqualToString:@""]) {

        NSURL *website = [NSURL URLWithString: @"http://192.168.1.2";];
        if (!website) {
            NSLog(@"%@ is not a valid URL");
            return;
        }
                NSHost *host = [NSHost hostWithName:@"http://192.168.1.2";];
                NSInputStream *iStream = [NSString stringWithFormat:@"ping"];
                NSOutputStream *oStream = [NSString stringWithFormat:@"ping"];
        [NSStream getStreamsToHost:host port:8000 inputStream:&iStream
                                          outputStream:&oStream];
        [iStream retain];
            [oStream retain];
        [iStream setDelegate:self];
        [oStream setDelegate:self];
        [iStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
                                           forMode:NSDefaultRunLoopMode];
        [oStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
                                           forMode:NSDefaultRunLoopMode];
        [iStream open];
        [oStream open];
    }
        
        
}



@end




but my 192.168.1.1 still not recieve nothing...
where i'm wrong?

Any help will be appreciated.
Thank you!

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to