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

how to upload file to openstack cloud using NSStream?

I'm trying to upload a large file on openstack cloud using their api. Anyone please give me some example of how to upload a large file to http server using NSStream. Thanks
iOS_Developer
  • 495
  • 4
  • 20
0
votes
1 answer

NSString compare returning NSOrderedDescending instead of NSOrderedSame

I am receiving the data in an iPad application from a socket connected. I am converting the data received to NSString using the method below: NSString *data = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]. Then I am creating a…
0
votes
2 answers

How to create a NSInputStream/NSOutputStream pair by accepting a server socket?

I know that you can create a NSInputStream and NSOutputStream pair (toll-free bridged to CFReadStream, CFWriteStream) by opening a TCP client connection using CFStreamCreatePairWithSocketToHost according to the Stream Programming Guide. How can one…
yonran
  • 18,156
  • 8
  • 72
  • 97
0
votes
1 answer

NSStream closing too soon

I have been doing a client-server communication for a while in iOS but I am here faced to an issue I have some troubles to understand. I wrote two basic functions: one to send data to the server and the other to receive data from the server. Each…
Besoul
  • 35
  • 6
0
votes
0 answers

NSStream and NSOperation request (0x1d17cd70) other than the current request(0x0) signalled it was complete on connection 0x1c5f4060

I,m using apples QRunLoopOperation https://developer.apple.com/library/mac/samplecode/PictureSharing/Listings/QRunLoopOperation_m.html in conjunction with the NSStream file…
okipol
  • 1,197
  • 3
  • 11
  • 27
0
votes
1 answer

new byte[]{0} in Objective C

I'm trying to port the following Java code to Objective C. myByteBuffer = new ByteArrayOutputStream(myCfA.length() + 1); myByteBuffer.write(myCfA.getBytes()); myByteBuffer.write(new…
Dantuluri
  • 685
  • 1
  • 10
  • 23
0
votes
0 answers

Objective C - NSOutputStream events arriving with delay

I'm scheduling stream objects on run loops, and the server retrieves the correct information etc, however after dispatching requests to write to the NSOutputStream I am receiving events a lot later than expected, screwing up control flow. I handle…
PidgeyBAWK
  • 319
  • 1
  • 4
  • 13
0
votes
1 answer

NSStream reading\writing outside the delegate method handleEvent:eventCode

in an iPhone app, I have a socket connection through wifi, and I need to read from inputStream and write to outputStream. The problem is that stream management is event-driven, and I have to wait for event NSStreamEventHasBytesAvailable before…
kevin
  • 75
  • 5
0
votes
1 answer

NSStream, sending/receiving data

I've written a server with Python (Twisted) and now want to connect it with iOS, but having some trouble. This is how I connect to the server: CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"localhost", 3000, &readStream,…
0
votes
1 answer

Handling data from server

I'm developing a project in which I need to connect the clients (iPhones) to a server. I've done this using CFStream, NSStream, etc. The server sends data packets that needs to be handled "one by one" in the client. The problem is that sometimes the…
0
votes
1 answer

NSOutputStream always writes zero bytes

Following precisely Apple's docs here: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Streams/Streams.html - I cannot get any network NSOutputStream to ever write data. It always returns a number that Apple's docs seem to…
Adam
  • 32,900
  • 16
  • 126
  • 153
0
votes
1 answer

MacOSX: creating a CFStream/NSStream with specific client and server ports

I'm trying to translate the client side of a (POSIX/winsocks) socket-based TCP/IP protocol to native Mac OS X frameworks. Under this protocol, a client port is set up at a specified port, and this socket is then connected to the server at another…
RJVB
  • 698
  • 8
  • 18
0
votes
1 answer

iOS: outputStream does not stay open

Okay so I'm implementing a NSOutput and Input Streams. When they are initialized, the streams open and connect to my TCPServer I have running on my PC, but then appear to close once outside of the initializing function or maybe the streams aren't…
justsomeguy
  • 115
  • 1
  • 11
0
votes
1 answer

NSStream closing and opening error

I'm working with NSStream to send and receive single characters over a network connection. I instantiate the streams both for reading and for writing using CFStreamCreatePairWithSocketToCFHost(...). The basic working mechanism to send and receive is…
Pablosproject
  • 1,374
  • 3
  • 13
  • 33
0
votes
1 answer

SSL in stream socket connection

I'm working in iOS application. I'm Trying to connect to https server with NSStream connection. With NSURLConnection, this work fine and i can trusted the challenge like this : -(void)connection:(NSURLConnection *)connection…
thelastworm
  • 544
  • 4
  • 14