Skip navigation.
 
mlRe: looks like Intel vs. PowerPC difference
FROM : Shawn Erickson
DATE : Thu Aug 03 20:11:28 2006

On 8/3/06, Andrei Tchijov <<email_removed>> wrote:
> It looks like
>
> +[ NSStream (void)getStreamsToHost:(NSHost *)host port:(int)port
> inputStream:(NSInputStream **)inputStream outputStream:
> (NSOutputStream **)outputStream ]
>
> works slightly different on Intel, compare to PowerPC.  On PowerPC,
> when this method fails, it will set inputStream/outputStream to nil.
> It looks like on Intel, in case of failure, it leaves inputStream/
> outputStream untouched.
>
> Does it sound right, or am I hallucinating?


The docs don't state what will happen to inputStream and outputStream
in the event of a failure (to bad it isn't stated). So you can't
safely depend on what the implementation will do since it isn't
specified. In a situation like that I would initialize them to nil
before sending that message.

Additionally I would query the status of the returned stream to
validate the state is as you expect (see -[NSStream streamStatus]).

-Shawn

Related mailsAuthorDate
mllooks like Intel vs. PowerPC difference Andrei Tchijov Aug 3, 19:37
mlRe: looks like Intel vs. PowerPC difference Sherm Pendley Aug 3, 20:04
mlRe: looks like Intel vs. PowerPC difference Shawn Erickson Aug 3, 20:11
mlRe: looks like Intel vs. PowerPC difference Andrei Tchijov Aug 3, 20:22
mlRe: looks like Intel vs. PowerPC difference Matt Neuburg Aug 3, 20:53
mlRe: looks like Intel vs. PowerPC difference Bill Bumgarner Aug 3, 20:55
mlRe: looks like Intel vs. PowerPC difference Sherm Pendley Aug 3, 21:05
mlRe: looks like Intel vs. PowerPC difference Bill Bumgarner Aug 3, 22:49
mlRe: looks like Intel vs. PowerPC difference John Stiles Aug 3, 22:55
mlRe: looks like Intel vs. PowerPC difference Kay Roepke Aug 3, 23:41
mlRe: looks like Intel vs. PowerPC difference Jakob Olesen Aug 3, 23:52
mlRe: looks like Intel vs. PowerPC difference Bill Bumgarner Aug 4, 00:05
mlRe: looks like Intel vs. PowerPC difference Kay Roepke Aug 4, 00:09
mlRe: looks like Intel vs. PowerPC difference Matt Neuburg Aug 4, 00:44
mlRe: looks like Intel vs. PowerPC difference Bill Bumgarner Aug 4, 00:53
mlRe: looks like Intel vs. PowerPC difference Matt Neuburg Aug 4, 04:05
mlRe: looks like Intel vs. PowerPC difference Nat! Aug 5, 18:03