Questions tagged [cfstream]

51 questions
8
votes
0 answers

How to use CFStream with RakNet on an iPhone?

I'm trying to create an iPhone app that will run in the background and uses Raknet transfer data between a client and a server. I followed a tutorial to get a simple chat client and server running. I want the app to be notified of incoming data when…
Nathan.Arnold
  • 188
  • 1
  • 7
7
votes
1 answer

CFStream crashes after setting SOCKS proxy config

What's wrong with the code below? I use AsyncSocket to connect to a SOCKS proxy and set the proxy settings on onSocketWillConnect delegate method. If I omit the calls to CFReadStreamSetProperty and CFWriteStreamSetProperty the socket connection will…
LaN
  • 228
  • 2
  • 9
6
votes
1 answer

How to configure CFStream (or NSStream) for SSL handshake?

I'm using CFStream/NSStream to make http connections. I want to be able to detect that a SSL handshake fails for three cases: case A: server is not trusted case B: server is trusted but asks a client certificate case C: server is not trusted and it…
MohG
  • 351
  • 4
  • 11
5
votes
0 answers

CFStream + SSL results in OSStatus error -108

I have some code that creates a pair of CFStream objects to a remote server with SSL/TLS enabled. This code works just fine on OS X, but when run under iOS, it fails. Here's the console log: 2011-04-26 22:39:35.820 RemoteSample[92127:40b] connecting…
Steve Madsen
  • 13,465
  • 4
  • 49
  • 67
4
votes
1 answer

CFStream Socket send packet not complete in IOS 7.0

I use CFStream Socket send data to Host. The first send is work. But after first, the data recv by host always be sperated. For example: First time Send: Sender: <11223344 55667788> Recver: <11223344 55667788> ok it's good second time, third…
4
votes
3 answers

Access a block of memory (/ C/C++ array) as if it were a file stream

Is there a way to do this in C (or C++)? Background info: I'm going to be reading either a memory block or a large file line by line and processing those lines one at a time and I'm lazy to write the same thing twice, once for memory blocks and…
Petr Skocik
  • 58,047
  • 6
  • 95
  • 142
3
votes
0 answers

Is the VoIP kCFStreamNetworkServiceTypeVoIP CFStream option flag effective for TCP server sockets on iOS?

I am making an iOS application where I have a TCP server socket (listening on some port) which is used to handle incoming connections and I would like to know if the kCFStreamNetworkServiceTypeVoIP options will be effective with it. The use case is…
woodleg.as
  • 274
  • 1
  • 4
  • 15
3
votes
1 answer

NSStream receive NSStreamEventEndEncountered during opening

I have a client - server app that uses NSStream to connect. sometimes when trying to open a connection, one side of the connection gets NSStreamEventEndEncountered when first trying to send a message. I use the bridge between CFStream and NSStream.…
impact27
  • 527
  • 4
  • 15
3
votes
2 answers

Is there some way to get a string description of CFStreamError?

I am using an API which has handed me a CFStreamError (which is supposedly deprecated, but Apple themselves obviously don't care.) I know some of the values and I could certainly write multiple nested switch statements to convert all the values I…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
3
votes
2 answers

Text Chat Application Using Socket Programming in iOS SDK

I want to implement a text chat functionality with the help of "Socket Programming" in iOS. I know about the process to connect to a server with the help of host and port like: CFReadStreamRef readStream; CFWriteStreamRef…
Hashim Khan
  • 440
  • 1
  • 5
  • 15
3
votes
0 answers

Running two NSStreams in two different threads

My app runs a network task in a separate thread - it gets data from my server, processes it and displays the results on an ongoing basis. This works fine when I have only one such network connection in one thread. However, if I run a second thread…
R.S
  • 321
  • 3
  • 15
2
votes
1 answer

CFStream with TLS

Is it possible to communicate on a CFStream with TLS 1.2? If yes, what is the best way? Setting a SSLContext or setting the CFReadStreamSetProperty? Unfortunately I cannot find any example for this.
Lupurus
  • 3,618
  • 2
  • 29
  • 59
2
votes
1 answer

CFStreamCreatePairWithSocketToHost crashes unexpectedly with Swift

Finally time to ask my first question here! Up front: Xcode 7.1.1, OS 10.11.2, iOS 9.0.2 (on physical device) I'm writing a small app that communicates with my Raspberry Pi. I've got some working code that's written in Obj-C (for iOS 7) borrowed…
Knight Artorias
  • 105
  • 1
  • 6
2
votes
0 answers

Proxy authentication in CFSteam based connection (iOS)

I have implemented CFStream based connection according to CFNetwork programming guide. How do I get credentials for authenticated proxy servers? Is there a way where I can get shared username and password stored by the system dialog, the dialog…
8suhas
  • 1,460
  • 11
  • 20
2
votes
0 answers

ASIHTTP Request: how to handle SSL certificate

I'm using ASIHTTP in my project, and I need to support SSL connections with or without client certificate. From my view, four cases are possible during SSL handshake: case A: server presents a trusted certificate but doesn't ask client to present…
MohG
  • 351
  • 4
  • 11
1
2 3 4