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
8
votes
2 answers

NSStreamDelegate not receiving NSStreamEvent.HasSpaceAvailable:

I had my code working in another project, in a class with the following signature: class ViewController: UIViewController, NSStreamDelegate, UITextFieldDelegate { Then I moved the connection to it's own class, so I can potentially reuse it in each…
user83039
  • 3,047
  • 5
  • 19
  • 31
8
votes
1 answer

NSStream SSL on used socket

I am writing an application that uses NSStream's SSL functions on the iphone. I know that SSL is working because I can directly connect servers using SSL. I have encountered a problem where protocols that use starttls require me to communicate on…
anurodhp
  • 356
  • 5
  • 13
8
votes
2 answers

Warning:Comparison of constant 8 with expression of type XXXX is always false

I used ASIHTTPRequest in my project,but in the file ASIDataCompressor.m line 190: if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { if (err) { *err = [NSError errorWithDomain:NetworkRequestErrorDomain…
yellow
  • 702
  • 1
  • 10
  • 24
7
votes
1 answer

Non-responsive stream delegate in Swift

So I was playing around with sockets in Swift and trying to connect the app with my server. I was having the app connect to the IP address of the server and used netcat on the server for testing. During execution, the console output from the app…
cafemike
  • 660
  • 5
  • 16
7
votes
1 answer

iPhone: Catching a Connection Error With NSStream

I have written a program that connects to a server on a given IP using the NSStream protocol outlined in Apple's stream programming guide. The connection and transfer of data works flawlessly, however if the user specifies the wrong IP and the…
isometrik
  • 409
  • 2
  • 9
  • 19
7
votes
1 answer

iOS NSStream tcp server client can't communicate

I have an issue with the development of a tcp server/client in objective c with Bonjour. On the server side I open correctly the streams and I use the handleEvent function to send and receive data. But I don't know what is the proper way to send and…
thegrandwaazoo
  • 301
  • 2
  • 15
7
votes
0 answers

Get connected service name using NSStream's and Bonjour based NSNetServices peer to peer

I have a problem with obtaining a connected service name on the other device. I am using NSNetServices based on Bonjour and input and output streams for peer to peer connections. I have an iPhone and iPad device. When I try to connect to the iPad…
piotr_ch
  • 508
  • 3
  • 7
  • 17
7
votes
1 answer

How to test if my remote socket NSStream are correctly open

TL;DR : What's the way to check if my remote stream are opened correctly after a call to NSStream.getStreamsToHostWithName(...)? My application is a mobile IOS8 swift application. I am using NSStream for input and output socket communication with…
user1585121
7
votes
1 answer

NSStream Failing To Receive Data

I am making a chat application using NSStreams that connect to a simple c socket server. The stream connects successfully, and sends data, but it is unable to receive the data. Here is my Socket class that uses NSStreams: Socket.h @interface Socket…
jamespick
  • 1,974
  • 3
  • 23
  • 45
7
votes
1 answer

Memory Leaks in CFStreamCreatePairWithSocketToHost iOS

I use NSInputstream & NSOutputstream to setup a connection and send data. My stream object has a function to open and close the stream. I use the following code: @interface Stream() { NSInputStream *inputStream; NSOutputStream…
Jim Craane
  • 186
  • 3
  • 10
6
votes
2 answers

Stream to Get Data - NSInputStream

All, I have a server that has a tcp socket stream for communication. I need to get to that stream and read the initial data that it needs to send me. My current code is as follows. To be honest, I'm going at this completely blind. I'm not sure if…
Baub
  • 5,004
  • 14
  • 56
  • 99
6
votes
2 answers

How to convert NSStream (NSInputStream / NSOutputStream) to SSL after stream opened?

I have NSInputStream and NSOutputStream from this code var readStream: Unmanaged? var writeStream: Unmanaged? CFStreamCreatePairWithSocket(kCFAllocatorDefault, sslSocket!, &readStream, &writeStream) if…
Adrian
  • 273
  • 1
  • 4
  • 14
6
votes
1 answer

how to disable Nagle algorithm on TCP connection on iPhone

I'm building a socket , using CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef) yourHostAsNSString, yourPortAsInteger, …
gkedmi
  • 61
  • 1
  • 4
6
votes
2 answers

How to deal with concurrency issues brought by NSStream run loop scheduling using GCD?

I have the following situation where I create a GCD dispatch queue and in it I schedule an NSStream to the current NSRunLoop, as is required in its specification for it to emit delegate events, and then I make the run loop for that thread run using…
Matoe
  • 2,742
  • 6
  • 33
  • 52
6
votes
2 answers

how to pipe data from NSOutputStream to NSInputStream in objective-c

I have 2 libraries that I want to integrate and make them talk to each other. Each of them listen on their own input and output streams. Library 1 will be the transport layer for library 2. Case 1: Library 1 receives data on its input stream I…
1
2
3
21 22