The NSOutputStream class is a subclass of NSStream that provides write-only stream functionality.
Questions tagged [nsoutputstream]
101 questions
2
votes
1 answer
Deadlock with NSOutputStream and URLSessionUploadTask (__psynch_mutexwait)
Our OSX app is uploading multiple files to the server using
func uploadTask(withStreamedRequest request: URLRequest) -> URLSessionUploadTask
While uploading, the upload gets stuck. Some files manage to upload successfully, sometimes more files…

Max
- 799
- 1
- 5
- 17
2
votes
1 answer
What does the hasSpaceAvailable property on NSOutputStream mean?
I'm trying to wrap my head around the logic behind hasSpaceAvailable on NSOutputStream.
In my app, I'm sending large amounts of data (100MB) broken up into 4080byte chunks (hard limit) over a CFSocket managed by NSInput/output streams.
When I start…

ecnepsnai
- 1,882
- 4
- 28
- 56
2
votes
2 answers
NSOutputStream blocking, HasBytesAvailable event was not triggered
I am trying to create custom framework that will deal with ExternalAccessory.framework to do read/write operation with the connected accessory.
I can able to create a session and open the device to do read/write operations.
Problem i am facing was,…

iosLearner
- 1,312
- 1
- 16
- 30
2
votes
0 answers
Save audio data from NSInputStream into a file
I'm using multipeerconnectivity framework to transfer audio samples (CMSampleBufferRef) from the microphone. I can pass the samples using NSOutputStream for send data and NSInputStream for receive data.
Once I receive the data in the other device,…

Pablo Martinez
- 1,573
- 12
- 31
2
votes
2 answers
Convert Int to UnsafePointer
I'm creating a TCP client in swift for an app on iOS device. I'm using NSOuputStream to send data on the server.
Our protocol is JSON type and we have to send first the length of the json (unsigned Int 32 bits) and then the JSON content (as UTF8…

bobby
- 105
- 1
- 10
2
votes
2 answers
Writing 64 bit int value to NSOutputStream
I'm having trouble communicating position coordinates to a set of motors I have connected on the network. I can send a string just fine, and receive text back from the motor, but I can't seem to send it an int value.
Using NSlog I have determined…

isometrik
- 409
- 2
- 9
- 19
2
votes
1 answer
Prevent a user from renaming a file while its being streamed from a remote ftp server cocoa
How to avoid a user from renaming a file while its being downloaded/streamed on mac programmatically using cocoa.
Breaking my head on this since 4 hours. Please help me. Thanks in advance.

Girish
- 21
- 2
2
votes
1 answer
NSOuputStream sends Old Value - Objective C
I have created code used for sockets for send/receive value. I did it all. first time it works well. I face the problem is Whenever i send the new value at second time, the old value is passed. like, first time i send 0 value to socket, the log file…

Ravi Kumar Karunanithi
- 2,151
- 2
- 19
- 41
2
votes
1 answer
swift OutputStream could not find member "write"
I'm trying for a while to send data to an OutputStream to communicate with another device. (For this i use the External Accessory Framework) But the function does not work. I have the error Could not find member "write". I hope somebody can help…

user3863490
- 21
- 2
2
votes
2 answers
create an empty file of specific size and write new data to specific position with fseek
I am new to ios
I have 10 chunks of 1024 bytes. this chunks are not in order.
If i know the number of chunk how can i insert the data in a file of size 10*1024?
So far i have the following code:
//method called when new chunk arrvies
NSArray…

just ME
- 1,817
- 6
- 32
- 53
2
votes
1 answer
iOS: SIGPIPE while accessing EAOutputStream after app returns from background
I have an iPhone app (iOS 7.0) which interacts with a Bluetooth 2.1 sensor device via the ExternalAccessory library. If the app gets backgrounded by any of the usual methods (locking, home button, auto-sleep, etc.) it gets a SIGPIPE when it attempts…

Joshua Sullivan
- 1,073
- 8
- 12
2
votes
2 answers
Putting NSString into uint8_t buffer
I'm working with sockets and trying to simply write a string to the socket. I found a couple of examples on how to do this, such as the following example (oStream is an NSOutputStream). This is all within the NSStreamEventHasSpaceAvailable.
uint8_t…

mjdth
- 6,536
- 6
- 37
- 44
2
votes
0 answers
Using NSOutputStream outputStreamWithURL with a custom URLprotocol
I'm writing a custom URL protocol (subclass of NSURLProtocol) to deal with local files that need a special way of reading and writing. No problem when reading: I can successfully create an URL like -for example- "my-funny-file-protocol://...." and…

roberto.buratti
- 2,487
- 1
- 16
- 10
2
votes
0 answers
NSStreamDelegate not receiving messages
I have a TCP connection class which uses the NSStreamDelegate and works fine. It receives messages and respond to them in any matter. In some cases it should open a second connection. This is a second class which is quite similar to the first…

Julian F. Weinert
- 7,474
- 7
- 59
- 107
2
votes
0 answers
Blocking of NSOutputstream despite open stream
I am trying to implement a simple TCP server on ObjectiveC/iOS. The minimal example boils down to the following: The server shall maintain multiple TCP connections. Whenever data (4 bytes) has been read, the server shall reply with an answer (4…

saum
- 123
- 5