开发者

NSURLRequest/NSURLConnection for tcp

开发者 https://www.devze.com 2022-12-17 20:06 出处:网络
Is it possible to send tcp request using NSURLR开发者_高级运维equest/NSURLConnection to an ip address and associated port from an iphone app, if yes than how?

Is it possible to send tcp request using NSURLR开发者_高级运维equest/NSURLConnection to an ip address and associated port from an iphone app, if yes than how? Using NSStream it is possible to establish tcp connection to an ip and port. I am trying to establish connection to a non apple device and using nsstream it works fine but it is not very responsive [may be due to the remote device] so I am looking for NSURLRequest/NSURLResponse way of doing the same thing. Can anybody suggest how to do this [if possible]?

A little googling leads me to this link http://lukassen.wordpress.com/2010/0...-on-iphone-os/ Is it a reason behind my problem with NSStream though I do not get any error Thanks

Arnieterm


No, it is not possible.

CFStream and/or NSStream are the only way to do it, eg:

http://dev.im.ethz.ch/wiki/Socket_communication_on_the_iPhone

or a wrapper around them:

http://code.google.com/p/cocoaasyncsocket/

0

精彩评论

暂无评论...
验证码 换一张
取 消