Questions tagged [nsstream]

NSStream is an abstract class for objects representing streams.

Filter by
Sorted by
Tagged with
2votes
0answers
374views

iOS 15 Beta 5(19A5318f) runloop run crash

After iOS 15 Beta 5(19A5318f) distribute,we find a new Crash (only based on Beta 5(19A5318f)) disappear. Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at ...
user avatar
  • 21
2votes
1answer
106views

Load Avplayer with large amount of data (decrypted output of a local file)

Am using below code for decrypting the VideoFile.mp4(CTR/Nopadding encrypted file) and playing it in Avplayer. This code works for small files. But its crashing for big video files due to memory ...
user avatar
  • 102
0votes
0answers
24views

nativescript: Property 'write' does not exist on type 'NSOutputStream'. ts(2339)

I'm missing something. I need to write a text file for ios using NSOutputStream. I create the file import { knownFolders, Folder, File } from "tns-core-modules/file-system"; const folder: Folder=&...
user avatar
1vote
0answers
147views

WatchOS 6 Socket Programming

I have an old Watch OS app that I need to update for WatchOS 6. Right now the watch app uses the iPhone extension to communicate with a computer that's running a server using NSStream. This is very ...
user avatar
0votes
1answer
118views

TCP socket setting in Objective C

I find a method like setReceiveBufferSize() in Java on Objective C. I use NSStream for TCP connection but there is no method of any kind of like that. If you know how to set a socket in IOS please ...
user avatar
0votes
0answers
95views

Main Thread blocking NSStream when checking if input is available on NSStream

I am working with a package called DSBridge to connect a mobile application (iOS code in this case) to javascript code containing the main logic of my application. This involves running the JavaScript ...
user avatar
  • 23
3votes
1answer
66views

Proper way to setup NSStreams?

I'm writing a little peer-to-peer bluetooth chat app. What I'm currently doing is: let thread = Thread(block: { [weak self] in guard let `self` = self else { return } self.channel....
user avatar
2votes
1answer
106views

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 ...
user avatar
  • 789
0votes
0answers
55views

What is the best way to store large file data into Coredata in iOS

I am trying to store 30k users details in to core data. To achieve this I search and came up with a solution to have all the data in a file in CSV format. I am able to download and read CSV file to ...
user avatar
  • 591
0votes
0answers
614views

How to create a custom websocket client in iOS, to send and receive JSON data?

I wanted to connect to a server, ws://12.526.712.67:8000/joker and was told to establish a connection, and check for success message, using WEBSOCKETS.Then I had to post a JSON data along with the ...
user avatar
2votes
1answer
137views

Difference between kCFStreamSSLLevel and kCFStreamPropertySocketSecurityLevel

Can someone please explain difference between these 2 properties? They accept same set of values defined in https://developer.apple.com/documentation/corefoundation/cfstream/...
user avatar
  • 185
1vote
1answer
148views

eaframework outputstream doesn't work on 11.2.1

- (void)_writeData { while (([[_session outputStream] hasSpaceAvailable]) && ([_writeData length] > 0)) { NSInteger bytesWritten = [[_session outputStream] write:[_writeData ...
user avatar
1vote
0answers
133views

NSStreamEventErrorOccurred is triggered while running the application in iOS 11

I am using the socket programming to connect to the local wifi for the communication . The code works fine in the versions lower than the ios 11 but on ios 11 the NSStreamEventErrorOccurred is ...
user avatar
0votes
1answer
805views

How to connect to wss socket where host name has additional path using NSStream?

I'm trying to connect to wss socket, and the host name looks like this: "myhostname.com/ws/v2". Here is how I start the connection: let host = "myhostname.com/ws/v2" ...
user avatar
  • 6,798
0votes
1answer
185views

Twitter Streaming API - Objective-C

I am working with the Twitter REST/Streaming APIs. When I want to access the REST API, I create a NSMutableURLRequest (that contains parameters such as access tokens and queries). I then use the ...
user avatar
0votes
0answers
29views

NSStream for swift works on simulator but not iphone

This code works on the simulator, but not on my iphone with ios 10.3.1. It is connecting to a python client. // // ViewController.swift // 1st robot app // // Created by Tristan Chandraratna on ...
user avatar
  • 31
0votes
2answers
305views

TCP Sockets not working on iPhone 7 running iOS 10.3.2

I am creating an app that communicates with an external service via a TCP Socket (NSStream). I am running into an issue on an iPhone 7 running iOS 10.3.2 whereby the NSStream is congested and ...
user avatar
  • 866
0votes
1answer
529views

Asynchronous NSStream I/O with GCD

I am working with an external device that I receive data from. I want to handle its data read/write queue asynchronously, in a thread. I've got it mostly working: There is a class that simply manages ...
user avatar
1vote
0answers
183views

NSStream with SSL - Cocoa Echo Server/Client - CFNetwork SSLHandshake failed (-9800)

I'm trying to configure and iOS device to connect to a macOS device over a WiFi network using Bonjour and NSStreams. I'd like to secure the connection via SSL. I started from Apple's Cocoa Echo ...
user avatar
0votes
0answers
220views

IPV6 wifi vs cellular

I am a little confused about some aspects of IPv6 if anyone know a bit more than me please fill me in. First off I use host names with the NSStream class so my app should be IPv6 compliant is this ...
user avatar
  • 213
0votes
0answers
345views

Check if delegate method was called

I have following function for connecting to a TCP Socket (Server on a Raspberry Pi, which I directly connect to via Access Point) func connect (host: String, port: Int) { Stream.getStreamsToHost(...
user avatar
1vote
1answer
122views

hasBytesAvailable finishing early

I am sending JSON from my server to my cocoa app. The cocoa app receives data like this: case NSStreamEventHasBytesAvailable: NSLog(@"begin"); if (theStream == inputStream) { int ...
user avatar
  • 3,641
6votes
2answers
873views

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

I have NSInputStream and NSOutputStream from this code var readStream: Unmanaged<CFReadStream>? var writeStream: Unmanaged<CFWriteStream>? CFStreamCreatePairWithSocket(...
user avatar
  • 263
7votes
1answer
2kviews

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. ...
user avatar
  • 650
1vote
0answers
484views

Swift NSStream delegate; reading is not working; stream func

Hi I have been working on this code now for a while and I cannot figure out why my stream func is not being called? I am building a joystick and it requires user interaction and it sends data but its ...
user avatar
0votes
0answers
216views

Swift 3 ViewDidLoad and NSStream;

is it possible to create sockets inside of ViewDidLoad? I created a NSStream socket inside here, opened it, wrote to it, closed and it hangs I need to send data with UI interactions; how can I do ...
user avatar
3votes
1answer
104views

How to generate certificate exception using NSStream during handshake

I am using NSStream to do the handshake as server, handshake is successful there is not issue. i get the client certificate and i validate and store it in to keychain. Now problem is i want to throw ...
user avatar
  • 361
0votes
1answer
254views

iOS: App is hanging when trying to close the stream

I created NSStreams to transfer something using the below code: dispatch_async(dispatch_get_main_queue(), ^{ // open input [self.inputStream setDelegate:controller]; [self.inputStream ...
user avatar
  • 47
1vote
0answers
248views

iOS Handoff - getContinuationStreams always fails

I'm trying to implement iOS Handoff with fetching bigger data via NSInputStream and NSOutputStream. When I successfully receive user activity in method application(_:continue:restorationHandler:) I ...
user avatar
  • 251
2votes
1answer
320views

Does [NSStream scheduleInRunLoop: forMode:] retain the NSStream?

I want to send and receive some data using nsstreams. I don't want to clutter my code so much, so I was wondering: Do I need to keep a strong reference to a NSStream or is [NSStream ...
user avatar
  • 1,086
0votes
1answer
119views

NSStreams-code works as expected just in the debugger mode

Everything work as expected just step-by-step throw debugger, otherwise I'm getting EXC_BAD_ACCESS. I guess that I need a delay somewhere or waiting(preferable) for something. // 1) Create streams(...
user avatar
0votes
1answer
239views

How to use a self generated ssl cert with NSStream(s) in Swift

I have a python server in the cloud that accepts socket requests. I have a Swift (xCode) client application that uses NS(in/out)putstreams to communicate with the python server app. I generated my ...
user avatar
2votes
1answer
632views

Stuck at hasSpaceAvailable and Can't read from NSInputStream

I got a problem when handling the stream events. I have a client app which connect to a server via TCP and constantly receive JSON datas from server. so far, I create the stream like this: // Create ...
user avatar
  • 311
0votes
1answer
55views

NSOutputStream to know when data has been read in the other side

I'm sending audio from the microphone in realtime from an iOS device to a server. The problem that I have: When it gets disconnected for any reason, I don't know actually how many data has been read ...
user avatar
0votes
1answer
124views

nsoutputstream stuck in status 1(NSStreamStatusOpening = 1) - iOS - objective c

i try to upload an iPod music to ftp server. so using AVAssetExportSession, i make a file at documents folder exportSession.outputURL = [NSURL fileURLWithPath:musicFilePath]; [exportSession ...
user avatar
  • 3
0votes
1answer
362views

Writes to NSOutputStream after performing work on background thread don't work

I have a program that is sending large files over NSStreams after some initial processing. The flow of the application goes like this: 1) Two devices connect to each other, open their input and ...
user avatar
2votes
1answer
763views

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 ...
user avatar
  • 1,702
0votes
1answer
157views

Bonjour/NSNetService Data written to NSOutputStream never makes it to the other side (includesPeerToPeer = true)

I have an iOS app that establish a peer-to-peer connection through Bonjour/NSNetService. (based on the WiTap sample code) In some cases, both devices won’t receive data anymore after a few seconds ...
user avatar
2votes
0answers
468views

CocoaAsyncSocket and True iOS Peer-to-Peer file transfer through NSNetService's includePeerToPeer setting

I'm trying to create an application that has the ability to transfer large files between iOS devices through what I'll call a "true" peer-to-peer network ie two devices connected directly to each ...
user avatar
1vote
1answer
520views

How to reliably retrieve NSData objects from NSInputStream in XCode

So my application works along these lines: An iPod continuously sends NSDictionaries that contain: an image encoded in JPEG and some image properties as NSStrings. The NSDictionary is encoded using ...
user avatar
1vote
2answers
627views

NSinputstream read data is returning null value?

In my app I'm using NSStreams for client server communication. In the delegate method in event hasbytesAvailable when I'm reading the data its returning null Case: when the length is 4096 then read ...
user avatar
2votes
1answer
322views

Difference between Apple TLS with Objective-C and Swift

I am using Apple's CFNetworking to get a TLS stream. I'm having a bit of trouble porting over the Objective-C code to Swift. With the exact same steps, it works when using Objective-C, but the ...
user avatar
0votes
1answer
70views

NSLog show strange character instead of the JSON

I have this code below that handles the response send by my server with sockets: uint8_t buffer[4096]; int len; NSMutableString *total = [[NSMutableString alloc] init]; while (...
user avatar
  • 233
0votes
0answers
130views

NSInputstream & EventEndOfStream

So this is my issue. A programs writes log files to a specific folder. Once a log file is created it is written to about every 2 seconds until it reaches approx 5MB. A new file is created then. I am ...
user avatar
0votes
2answers
556views

Detect how many bytes can be written to NSOutputStream

Basic problem I'm try to implement: I have two streams. NSInputStream and NSOutputStream. Now I want to take some data from input process them (add some frames encode them and so on) and pass to ...
user avatar
  • 27.1k
1vote
1answer
733views

objective-c socket programming with NSStream

I create a MySocketClient class which implements NSStreamDelegate, and implements the method - (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode and then call the bellow function ...
user avatar
  • 633
0votes
0answers
52views

How can a client know that Server is sending some X bytes?

let bufferSize = 4096 var buffer = Array<UInt8>(count: bufferSize, repeatedValue: 0) var message = "" while inputStream.hasBytesAvailable {...
user avatar
0votes
1answer
475views

How can i wait till i receive all the tcp packets to Client from Server using NSStream

case NSStreamEvent.EndEncountered: BBLogMsg("End Encountered") guard let inputStream = self.inputStream else { return BBLogError("no input stream") }...
user avatar
1vote
1answer
367views

Stop NSStream runloop in same NSThread

I'm trying to run NSStreams in a thread in my project. I created a thread below: self.thread = [[NSThread alloc] initWithTarget:self selector:@selector(createStreams:) object:handler]; [self.thread ...
user avatar
  • 47
1vote
0answers
554views

swift - How to give and parse data from swift?

I'm a socket project in swift. I try to give data that are JSON and Parse them but i have two problem: 1- when I received data are incomplete and return nil value for some bytes. 2- I don't know ...
user avatar
  • 85

15 30 50 per page
1
2 3 4 5
7