Re: Telnet Networking Example
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Ns0TlMd4zM8jPTkmX2D+e6exa4dRBjz1plSr24N2Xq0=; b=p7YBdIb9YkqnU5hfqLKf+p7/Y8nIJwE2ot8ves56CG94E5epRNZmVl3PGNLagGMnSI nzXq1F7/5xxYObxNlB/aCWuc8NaIAJfb8uPS0yVAt1w/gafqmPS/1ugZMyBf4ppGPlfA GjB4ouzvBcQlIkP37QgUCetLRfR+SuVvqv5QM= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=W7RBu762thxteDpETnxPHicWb/UueY1UZk4oQp1u6OCjrJWqgT14vWI3ovGID67Wf4 XjiF0NOcsPW6TJnmIZcX6CF3+V2EEkAQlfZEEfXYz4ezNq1TpiZ9hh1ORMYfstcJvaqj +4SXrKnYUJ7ZtTbWpZA8b1RPKWE4402Lbl3rY= Ah, yes, that is the problem. server_host = @"127.0.0.1"; NSURL *website = [NSURL URLWithString:server_host]; if (!website) { NSLog(@"%@ is not a valid host address"); return; } NSHost *host = [NSHost hostWithName:[website host]]; On Jul 23, 2009, at 5:02 PM, Eli Bach wrote: On Jul 23, 2009, at 2:56 PM, DerNalia wrote: you're right, oStream isn't pointing to anything, but shouldn't [NSStream getStreamsToHost:host port:server_port inputStream:&iStream outputStream:&oStream]; take care of that? It should. Eli _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/theprecognition%40gmai... _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists.... My host is nil. So it would make sense for a nil host to return nil streams. So, this is how I'm making my host object before invoking getStreams. website is always valid, so my problem is when I make my NSHost. So I looked in the documentation to see if there was another way to make an NSHost. The host successfully was created with NSHost *host = [NSHost hostWithAddress:server_host]; and the streams are now no longer nil. So, now the only problem is sending the right commands to my server. Thank you so much! I figured that having Garbage Collection on might be the problem, so I moved all the open stream code to the same method that calls getStreamsToHost, but I get the same result. So, just to see if the Garbage Collector was pulling a fast one on me, I temporarily turned it off. But I get the same result. Have you stepped over this line of code and verified that iStream and oStream are set to non-nil values after this line of code? And is all this code (getStreamsToHost:... and write:maxLength: ) in the same function/method and if not, is the value saved/passed between the various functions/methods? This email sent to theprecognition@gmail.com This email sent to site_archiver@lists.apple.com
participants (1)
-
DerNalia