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
1
vote
1 answer

Can an open, but inactive, NSStream that is scheduled on the main thread be moved to a different thread?

I am using (and am required to use) a third-party framework to which I do not have source. The third-party framework handles creating an authenticated client/server connection and hands back a pair of open NSStreams. The challenge that I have is the…
xyzzycoder
  • 1,831
  • 13
  • 19
1
vote
0 answers

NSStream does not call it's delegate when closed everytime

I have a couple of NSStreams (in & out TLS) to a server, I can send and receive data via them just fine but after a while maybe 5 minutes after without any traffic, connection seems to be closed on it's own but my delegate does not called with…
volution
  • 533
  • 3
  • 15
1
vote
1 answer

CFReadStreamRef vs. NSInputStream *

The difference between NSInputStream * and CFReadStreamRef seems to be that the first one is an objective C object, while the second one is a native struct. Nevertheless, they are toll-free bridged. I want to implement a program based on network…
Etan
  • 17,014
  • 17
  • 89
  • 148
1
vote
1 answer

Replacing a call to sleep when waiting on an NSStream response

I made an application which uses NSStream to etablish a connection to a telnet server. When the connection is made, I send a first command. Then I use sleep(1); to make my application wait. Then the second command is sent. The problem is that the…
Nono
  • 241
  • 5
  • 15
1
vote
1 answer

Parse Image and Extension From URL Objective C NSScanner

I have a program that will be grabbing a image from our server for the app, however we want to save the image onto the iOS app for caching purposes. The url would be similar to this. http://www.example.com/image/app_name/mypicture.png I need a way…
Dfranc3373
  • 2,048
  • 4
  • 30
  • 44
1
vote
2 answers

NSStream, UTF8String & NSString... Messy Conversion

I am constructing a data packet to be sent over NSStream to a server. I am trying to seperate two pieces of data with the a '§' (ascii code 167). This is the way the server is built, so I need to try to stay within those bounds... unichar asciiChar…
Dutchie432
  • 28,798
  • 20
  • 92
  • 109
0
votes
2 answers

iOS - receiving binary data from server only works in debug mode

I have a question concerning my last post But I think at first I should provide some code: This is the function to handle my created object - (void)handleObject:(NSMutableData *)object { NSLog(@"[object length] = %d", [object length]); Byte…
Bautzi89
  • 346
  • 1
  • 5
  • 21
0
votes
1 answer

Socket issues between iOS and .NET?

I have a .NET desktop program running as a server and I'm trying to implement a port of my client program in iOS, but I'm getting some odd behavior from NSSocket. Here's the relevant code from the server. public NetworkListener() { _Stream =…
Duck Jones
  • 380
  • 1
  • 5
  • 16
0
votes
1 answer

warning: Attempting to create USE_BLOCK_IN_FRAME

I get this warning in Xcode warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame. Xcode redirect me to my NSStream _naturStream = [[NSInputStream alloc] initWithData:natur]; It is random when it does this…
Roskvist
  • 1,030
  • 3
  • 14
  • 24
0
votes
0 answers

How to read data from NSInputStream directly via UIWebView?

UIWebView provide ability to display content from NSData. Is it possible to use NSStream instead of NSData as the source for content?
ingeniarius
  • 1,526
  • 1
  • 9
  • 3
0
votes
1 answer

NSStream seems to some how truncate data

I am pulling my hair out over this. I am sending a few pieces of data to the server, so i put it in the buffer, and then send the buffer. Everything seems fine, but on the server, the string is being cut off, at different points, so for example I…
nycynik
  • 7,371
  • 8
  • 62
  • 87
0
votes
0 answers

CBL2CAPChannel not responsive while app is backgrounded

I'm facing an issue where L2CAP (or NSStream) stops notifying events to the app after app went to background (after 2-10 seconds). App is probably being suspended (as expected). My expectation is that when there's BLE activity, app should be awaken…
0
votes
0 answers

NSStream (BLE L2CAP) on background thread

I'm looking for some verification of what i'm doing. Also, there's a lot of related topics here and there but none is complete / addresses all challenges. Overview / Requirements: BLE (L2CAP) Central able to talk to multiply simultaneously…
0
votes
1 answer

accessing low level attributes of a NSStream

I have a Keyspan PCI to RS-422 adapter that I'm using to connect old serial devices to a Macintosh. I would like to use NSInputStream and NSOutputStream to read and write so that I can take advantage of asynchronous nonblocking I/O since there will…
0
votes
0 answers

How to send simple data (like a string) between iPhone and Mac using NSStream

I've been googling around to try and find a tutorial or some info on how to establish a connection between my Mac and iPhone and send a simple piece of data such as a string between them. All of the tutorials i have found use bonjour or do something…
A Person
  • 801
  • 1
  • 10
  • 22