Questions tagged [nsinputstream]

NSInputStream is an Objective-C class on iOS , a subclass of NSStream that provides read-only stream functionality. NSInputStream is “toll-free bridged” with its Core Foundation counterpart, CFReadStreamRef.

150 questions
1
vote
1 answer

Can get NSInputStream data and play video

I'm using NSSInputStream & NSOutputStream to send and receiver data, In server(I named it): open stream to send data to client - (BOOL)openStreams { //NSLog(@"SERVER: Open stream"); [self.delegate callbackMessageFromServer:@"SERVER: Open…
Giang
  • 2,384
  • 2
  • 25
  • 26
1
vote
2 answers

Read bytes into a Swift String

I have a binary file test.data containing the following data: 01 E6 B5 8B E8 AF 95 02 The first byte is just for example a sequence number 01. The next 6 bytes are two UTF8 Chinese characters "测试".Then the 8th byte is again another sequence number…
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
1
vote
0 answers

iOS Simulator outputstream sends differently than iPhone's outputstream

My iOS app requires socket communication. I'm following this Ray Wenderlich tutorial for setting up the input and output streams. The server I'm using is Twisted. My app requires sending and receiving fast bursts of data generated by external events…
raj
  • 187
  • 1
  • 11
1
vote
0 answers

iOS input stream receives fast data only if output stream is simultaneously sending

My iOS app requires socket communication. I'm following this Ray Wenderlich tutorial for setting up the input and output streams. The server I'm using is Twisted. My app requires sending and receiving fast bursts of data generated by external events…
raj
  • 187
  • 1
  • 11
1
vote
1 answer

Multipeer Connectivity iOS 7 m4a Audio Streaming

I'm using this tutorial http://robots.thoughtbot.com/streaming-audio-to-multiple-listeners-via-ios-multipeer-connectivity, and works nice for mp3, but nothing with m4a, someone know a best way? for play audio from a NSInputStream (MCSession…
1
vote
1 answer

Can't read custom file from NSInputStream

I am trying to read a custom file from my documents directory via NSInputStream to upload it to a FTP server. I'm using the exact same code as demonstrated in the SimpleFTPSample provided by Apple. It seems to work fine as long as the file is empty,…
Larry
  • 205
  • 1
  • 9
1
vote
1 answer

Data is added from server

I am working on an app that is using NSOutputStream and NSInputStream to try it out and see what I can make happen. I have modified This tutorial to allow me to use a old computer as a server! What I am having an issue with is i am trying to send…
Charlie
  • 222
  • 3
  • 20
1
vote
1 answer

Writing To NSStream Relying on hasSpaceAvailable method or Delegate Event NSStreamEventHasSpaceAvailable

While writing onto NSStream Should i Rely on 'hasSpaceAvailable' method or the event in the 'handle:event' method 'NSStreamEventHasSpaceAvailable' Or Should i check 'hasSpaceAvailable' if not available, i have to retry after a particular amount of…
raghul
  • 1,008
  • 1
  • 15
  • 33
1
vote
1 answer

Trouble using NSInputStream

Total novice trying to program a basic iPhone app. I wrote the code for a server and can send lines from my app to the server but I'm having trouble receiving lines from my server. Also this app seems to only work when I run through it using the…
1
vote
2 answers

iOS - Setting delegate of input stream to another class

i am wondering that if it is possible to set the delegate of input stream to another class. So far all examples i have encountered are with self: [inputStream setDelegate:self]. I want to set delegate to another class like a ViewController not self.…
1
vote
0 answers

Error deserializing json stream

I have an NSInputStream *inputStream receiving small JSON objects from a network connection. If I read the stream to a buffer like so: NSError *err = nil; uint8_t buffer[1024]; NSMutableData *data = [[NSMutableData alloc] init]; while ([inputStream…
Richard
  • 3,316
  • 30
  • 41
1
vote
0 answers

iOS - NSInputStream with Sockets: background thread

I have a SocketCommunication class which is created with the following code CFReadStreamRef readStream; CFWriteStreamRef writeStream; CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)host, port, &readStream,…
Thomas Geulen
  • 201
  • 5
  • 14
1
vote
1 answer

NSInputStream can't read from TCP Connection [TCP-Server]

I created a TCP server using this (quite old) example by Apple. My server is up and running, listening on the specified Port for incoming connections. Everything looks perfect, my client app can connect to the server and -stream:handleEvent: is…
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107
1
vote
1 answer

Reading a .mov file with NSInputStream while writing with AVCaptureMovieFileOutput

Goal: Use AVCaptureMovieFileOutput to record video to a .mov file. While video is recording, I want to upload it to S3. The uploading part should be feasible with Multi-Part upload. (Mac OS X +10.8 app) Problem: How do I read from a .mov file in…
Jonas Bylov
  • 1,494
  • 2
  • 15
  • 28
1
vote
0 answers

NSSreamstatus if i am getting data or not

I have NSInputStream , i want to check if i am getting data from other end , i read the NSStreamStatus , i cam across that "NSStreamStatusReading" is use to check the read data . I tried to check that status but its not working can any one tell me…
Diaaaaan
  • 35
  • 6