Questions tagged [nsstream]

NSStream is an abstract class for objects representing streams.

NSStream is an abstract class for objects representing streams. Its interface is common to all Cocoa stream classes, including its concrete subclasses NSInputStream and NSOutputStream.

NSStream objects provide an easy way to read and write data to and from a variety of media in a device-independent way.

For more information : NSStream Class Reference

327 questions
0
votes
2 answers

manage socket stream in tabBarView

I'm developing an app using UITabBarController. More specifically, using the storyBoard. I want all of my tab to be able to send and receive data from the server. Problem is i don't know how. Only the first tab that have initNetworkCommunications…
0
votes
1 answer

NSStreamStatus changing manually

is there any way to change the streamStatus manually NSStreamStatusNotOpen = 0, NSStreamStatusOpening = 1, NSStreamStatusOpen = 2, NSStreamStatusReading = 3, NSStreamStatusWriting = 4, NSStreamStatusAtEnd = 5, …
meth
  • 1,887
  • 2
  • 18
  • 33
0
votes
1 answer

Close NSStreams when app goes to background

I am new to objective C and ios development. I generally program Android apps with Java and always used the onPause call to close my sockets. However when I call my close socket method under applicationWillResignActive I loose communication with…
Travis Elliott
  • 291
  • 2
  • 5
  • 18
0
votes
0 answers

Is there an advantage of using NSStream directly (as opposed to CFNetwork, BSD sockets, etc.)

I am familiar with several of the different ways to do TCP connections (CFNetwork, BSD Sockets, etc.) but I recently discovered NSStream has "XXXwithURL:" APIs which allow TCP connections only using NSStream. Is there any advantage to creating…
Locksleyu
  • 5,192
  • 8
  • 52
  • 77
0
votes
1 answer

CFReadStreamCopyError report error on iPad device

I am running into an issue. Same code running OK on iPhone (iOS 5) and iPhone/iPad simulator. But it does not work on an iPad (iOS 5). I'd appreciate any help. Here is read port code: //Code for read port. CFIndex bytesRead =…
user459014
  • 21
  • 3
0
votes
1 answer

NSTimer is not fired in time

I am trying to connect to a port on a given IP Address. The one problem is that when a connection is established with a non existent IP Address the write command (which is as follows): NSData * imageRequest = [@"640" dataUsingEncoding:…
0
votes
2 answers

Data gets truncated when sending over NSStream

Ok so I have been at this bug all day, and I think I've got it narrowed down to the fundamental problem. Background: I am working on an app that has required me to write my own versions of NSNetService and NSNetServiceBrowser to allow for Bonjour…
RyanM
  • 4,474
  • 4
  • 37
  • 44
0
votes
1 answer

How to fix naive server implementation with CFSocket to allow multiple connections

I have been studying the bonjour/NSStream sample code from lecture #17 of Stanford's CS193p course (iOS programming) on iTunes U from the winter of 2010. The example code is available here. In a nut shell, the sample code creates a socket and binds…
RyanM
  • 4,474
  • 4
  • 37
  • 44
-1
votes
1 answer

does iOS let the app finish what it's doing before being suspended?

If you have something processing and the user presses the home button, does iOS let the app finish processing until it's finished? I have an NSTimer that calls a function every half second, and I want to know if iOS sort of freezes the app where it…
Kevin Schildhorn
  • 197
  • 2
  • 16
-1
votes
1 answer

Incompatible pointer type 'uint8_t *' send to 'uint8_t **' - How can it be fixed?

I get the warning Incompatable ponter type 'uint8_t *' send to 'uint8_t **' when passing value to parameter 'buffer' in below method in NSStream class - (BOOL)getBuffer:(uint8_t **)buffer length:(NSUInteger *)len; Below is the code I am using.…
-1
votes
1 answer

NSJSONSerialization error

I'm trying to send json object to server. But I received an error and I can't fix it. -(void) connectToHost{ CFReadStreamRef readStream; CFWriteStreamRef writeStream; CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"localhost", 9123,…
meth
  • 1,887
  • 2
  • 18
  • 33
-4
votes
1 answer

What is the iOS equivalent to Android Socket programming code?

I have some socket programming code in Android (Java) and I want to implement the same thing in iOS (Objective-C). On iOS, NSStream, NSInputStream, NSOutputStream are some of the classes for socket programming. I have doubts when comparing them to…
Dhanunjaya
  • 500
  • 1
  • 5
  • 13
1 2 3
21
22