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

CFStreamCreateBoundPair streams lose data with small buffer size

I am attempting to create a streaming html parser with libxml2 in Objective-C. I have a NSURLConnection that downloads the data, and I have created in NSInputStream and NSOutputstream with CFStreamCreateBoundPairwith a small buffer size of 10 bytes.…
Otium
  • 1,098
  • 8
  • 20
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
1
vote
1 answer

Objective C NSStream connection always refused

I'm trying to setup some NSInput/Output streams in Cocoa and cocoa touch. I'm attempting to create a connection between my Mac and my iPod over Wifi. No matter what, though, I always get connection refused errors. I have each devices' address hard…
Sequence
  • 113
  • 2
  • 9
1
vote
2 answers

NSstream write encoding issues

Im trying to send a string using NSoutputstream , however i cant seem to get the encoding right , using dataWithContentsOfURL works im using a nodejs TCP server with actionHero library. it works using netcat and telnet. -…
henghonglee
  • 1,732
  • 3
  • 20
  • 29
1
vote
1 answer

NSInputStream not opening stream/ How to post data when setting up stream

What I am trying to do: I have a url request (post) where I send some information to a api server which then starts streaming data in bytes to me. 1) How do I post data when trying to set up a stream as right now I am just using a url, can I…
Osman
  • 1,771
  • 4
  • 24
  • 47
1
vote
3 answers

Transfer Multiple Images via NSInputStream/NSOutputStream

I have two NSInputStream and NSOutputStream connected to each other via network. I want to transfer core data objects and associated images from one device to other device. I have successfully converted the core data objects into JSON and…
Abbas Awan
  • 113
  • 1
  • 14
1
vote
1 answer

NSInputStream and NSOutputStream problems

I have two NSInputStream and NSOutputStream between devices that are connected to each other via network. When I write something in output stream, the data is written until the NSStreamEventEndEncountered event occurs. I close the output stream but…
Abbas Awan
  • 113
  • 1
  • 14
1
vote
1 answer

Sending C++ Protocol Buffer Messages from iOS

In a previous Stack Overflow question, people were super helpful in showing me the error of my ways while building my Akka socket server and I actually now have an Akka socket client that can send messages with the following framing: message length:…
Kevin Hoffman
  • 5,154
  • 4
  • 31
  • 33
1
vote
0 answers

iOS socket programming - receiving nsstream event 4

I am using a device called a WiFly that has ip address:169.254.1.1 and port 2000. I am trying to connect to this device via an iOS application. I use the following code to connect: CFReadStreamRef readStream; CFWriteStreamRef writeStream; UInt32…
thebiglebowski11
  • 1,451
  • 10
  • 41
  • 76
1
vote
0 answers

how to make two tcp connectinos in ios app

I am working on an ios app that needs to make tcp connections to two servers with different addresses. Does NSStream can make it, how to do that? shuold I put one communication on a separate thread?
sion
  • 11
  • 1
1
vote
1 answer

How to send and received data from external accessory asynchronize

I am confused about send and received data from external accessory asynchronized way. I use MFi External Accessory, I checked EADemo, but seems that send and received data synchronized way. Any suggestions about this, thanks in advance.
1
vote
1 answer

using NSInputStream/NSOutputStream to communicate over TCP (iPhone)

Is it possible to do TCP communications using NSInputStream/NSOutputStream on iPhone? The example apple gives in their documentation uses [NSStream getStreamsToHost] and that isn't supported on iPhone. I have seen other posts which use CFStream to…
Locksleyu
  • 5,192
  • 8
  • 52
  • 77
1
vote
1 answer

iOS: How to load a portion of a larger file for uploading?

I am working with large instances of ALAsset and I am trying to split the asset up into smaller chunks for uploading. What is a good approach to split a large file up into smaller chunks without loading the entire file into memory?
1
vote
1 answer

NSStreamEventErrorOccurred triggered even if the network is pretty strong signal

I have implemented the NSStream delegate. I have implemented the same as Witap Application In that, I have implemented handleEvent delegate - (void) stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode{ switch(eventCode) { …
Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102
1
vote
1 answer

Good Example of network-based NSStreams on a Separate Thread?

Does anyone know of a simple example that creates (network-based) NSStreams on a separate thread? What I am actually trying to do is unschedule (from the main thread) and reschedule (to a helper/network thread) an open NSInputStream and…
xyzzycoder
  • 1,831
  • 13
  • 19