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
0 answers

Wait socket response in objective c

I am using socket for send and receive data runtime but in some cases, i still need to wait the response from server. In http request, i use: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ …
Jonny Vu
  • 1,420
  • 2
  • 13
  • 32
0
votes
0 answers

EXC_BAD_ACCESS with NSStreamEventHasBytesAvailable

This is a very confusing error, as even if I send and receive the same data it sometimes happens, sometimes doesn't. I am receiving a stream via NSInputStream and I use standard code to read the bytes received in that stream and pass them onto…
0
votes
0 answers

button touch up inside event not being triggered always

I am currently working on an application that is pretty similar to a chat app so what I did is I created my own server and in the app I am using streams to send messages to the server and retrieve messages from it. I have many functions that require…
tudoricc
  • 709
  • 1
  • 12
  • 31
0
votes
0 answers

Flush NSStream without it adding newline characters

I have a problem with flushing the output stream of my socket client application for iOS. I need to flush the stream without adding a \r\n or \n. The server doesn't accept additional bytes in the sent telegram. Is there any way to flush without…
0
votes
1 answer

'NSInputStream' does not have a member named 'setDelegate'

I use NSStreamDelegate protocol in A UIViewController subclass, And then send setDelegate message to a NSInputStream. var input : NSInputStream? var output: NSOutputStream? func connectToSocket(host: String, port: Int) { …
Chen-Tsu Lin
  • 22,876
  • 16
  • 53
  • 63
0
votes
1 answer

How to use NSStreamEvents in Swift?

I have trouble using the events my NSStream objects throw. In obj C it is something like this: - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { switch (streamEvent) { case NSStreamEventOpenCompleted: …
Mads Gadeberg
  • 1,429
  • 3
  • 20
  • 30
0
votes
1 answer

iOS - Issue recieving data from NSStream

I am making an application that senses iBeacons. When you get within immediate range of an iBeacon the application sends the major and minor numbers of the beacon to a server and the server sends back an image that is stored in a MySQL database,…
ThriceGood
  • 1,633
  • 3
  • 25
  • 43
0
votes
3 answers

Upload image from Image Picker to Web server in Stream format

I need to upload the Image into the web server in stream format. Here i used Image Picker to select the images from the gallery.
user3732709
0
votes
0 answers

NSInputStream freezes app after opening stream in iOS6

I am using NSInputStream to grab some resources from web like this: CFHTTPMessageRef request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, CFSTR("GET"), (__bridge CFURLRef)url, kCFHTTPVersion1_1); CFReadStreamRef readStream =…
0
votes
0 answers

Socket programming-rajay

Am using below mentioned code for receiving data from the server by using socket programming. but receiving is not working here.but server connection and sending data are working fine.How to receive data from server. case…
0
votes
2 answers

ios multiple NSStream handlers

am new to ios programming. my app is linking with a library that opens NSStream and uses them as below: [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [outputStream…
user3282227
  • 131
  • 2
  • 10
0
votes
2 answers

iOS NSStream Socket Read TCP erratic and truncated

I am using the following code to read from a server socket. Everything starts out fine, but as things progress the data returned gets truncated and chunked incorrectly. I've read all over trying different things like changing the buffer size and…
chrislhardin
  • 1,747
  • 1
  • 28
  • 44
0
votes
1 answer

iPhone SDK: phone to phone file transfer

What is the simpliest approach to copy files from iPhone to iPhone (p2p). The only way I can come up is this: Use Bonjour to discover server app (which will advertize itself via Bonjour) Use NSStream (or sockets) and then stream data from the…
leon
  • 1,412
  • 2
  • 17
  • 26
0
votes
2 answers

Strange issue with VoIP socket(stream) only on one iPhone

I have recently encountered very strange issue. I have a VoIP app. I install the same build on 4 iPhones (3 iPhone 5s and 1 iPhone4(iOS6.1)). Then I put app into background. 2 iPhones 5s and iPhone4 keep receiving data as they supposed and only one…
user1264176
  • 1,118
  • 1
  • 9
  • 26
0
votes
1 answer

NSStream write to socket gives no error with WiFi turned off. Why?

Good Day, I am writing a custom controller on the iPhone for an application running on a PC. I am using standard coding to set up & open a socket & write/receive data on my ios client. All worked well until I went to an area with a weak wifi…
rbwater
  • 91
  • 4