What is the equivalent to WinSock in the iPhone SDK? - iphone-sdk-3.0

I need to communicate with a hardware device using TCP and with Windows I would use WinSock.
What is the equivalent library that I can use from the iPhone SDK?

There isn't anything like winsock per-se, there is Objective-C wrappers around POSIX Sockets, like NSUrl and the like. This (Network Programming - iPhone SDK) might help with getting an idea about what is available.

WinSock is Window's version of the BSD socket. iPhoneOS being Darwin having a BSD user-land of course has a socket API (<sys/socket.h> etc) too.
See http://en.wikipedia.org/wiki/Berkeley_sockets.
In CoreFoundation there is also a higher level API called CFSocket. (The Foundation version, NSSocketPort, is not available on iPhoneOS.)

Related

Using CoreBluetooth to connect to Windows10 with iOS devices

Question1.
IOBluetooth can support connection both ways via LE or classic. However it only supports macOs. CoreBluetooth supports only up to LE along with IOS.
As far as I know, in order for me to connect my bluetooth connection within IOs device, I must use CoreBluetooth frameworks. Am I correct?
Question2.
CoreBluetooth frameworks can connect Windows10 labtop with bluetooth connection?
Your question is a bit vague. I assume you just want to have a way to exchange some data between an iOS app and your Windows 10 desktop.
Yes, you are correct. Usage of Bluetooth Classic in any of your iOS apps requires Apple MFI Membership and only makes sense if you have your own product. If you are not a member of the MFI program then you are left with CoreBluetooth (BLE). Please note, that BLE is significantly slower than Bluetooth Classic so it only makes sense for applications that require transmission of small data packets (expect around 4kB/s max).
Yes, as long as your Windows 10 device supports BLE. If you want to use any of the SIG adopted Profiles such as HID over Gatt you should be able to connect without any additional software. Otherwise you need to implement your own profile. If you want to know more about your options, I suggest you have a look at the CoreBluetooth documentation and/or get a copy of Getting Started with Bluetooth Low Energy which is a comprehensive read on the topic.

Need information on IOBlueTooth

I need to know few things about IOBlueTooth framework for MAC:
Does this framework support BTLE?
What different does it has from iOS framework CoreBlueTooth?
To support BTLE on MAC OSX, do we need both IOBlueTooth & CoreBlueTooth framworks? Please share link for some sample app, if any?
Also, please point me to some good documentation or WWDC videos for IOBlueTooth framework.
1.) Yes..assuming you have a mac that supports BLE (airs, minis, and newest macbook pro's i believe)
2.) The IOBluetooth framework contains C and Objective-c api's to connect to nearby Bluetooth devices (not only BLE devices). So yes, it contains the CoreBluetooth.framework, but the IOBluetooth framework allows you to interact with Bluetooth devices supporting other protocols as well.
3.) You need to import the IOBluetooth.framework since CoreBluetooth.framework is embedded inside it, but that's all you need to do with it.
Check out the Heart Rate Monitor sample code.

Objective-c networking on iPhone

I would like to connect to a server on tcp/ip to the port 65000 from my iPhone app. I tried to read about CFNetwork sockets and the connecting documentation, but didn't success with these helps. Can you point me to the right way please?
I suggest you take a look at the AsyncSocket class. It's an easy-to-use Objective-C wrapper class for CFNetwork and works flawless and painless. I use it in a lot of my projects and I couldn't recommend it more.

How to use sockets on objc?

I want to use p2p in my game. How can I get IP adress and use sockets on objc?
Please help me.
OS X includes standard BSD sockets. Type man socket in the Terminal for the socket API docs.
Use raw BSD sockets as you have always done. But are you sure you do not want to use a better abstraction provided by Core Foundation or Foundation?
I think you should look at session 207 and 208 of WWDC 2010, where Quinn "the Eskimo!" details proper, safe and efficient networking on iOS.
http://developer.apple.com/videos/wwdc/2010/

Carbon development on intel based mac

I am trying to make an application on mac.i am trying to develop a user authentication module that uses the OS authorization dialog and use its functionality in my application. i have two questions regarding the mac development;
1) Is there a possibility to port the carbon applications to cocoa? (i don't have any concern
with 64 bit, i want to develop in cocoa for simplicity and also because it doesn't go to
low level programming.)
2) secondly, please tell me that i am using an intel based mini mac with OS 10.5, so, if
there is no possibility of porting the carbon application to cocoa then can i develop on
this intel based mini mac for Carbon?
Regards
Yes, but there's no automatic way to do it. If you write your Carbon application in C++, then you can use Objective-C++ to integrate Cocoa without having to change your existing classes too much, but you still have to do all of the heavy lifting.
You can develop Carbon applications on OS X 10.5.
Note that Apple's "Getting started with Carbon" guide is now part of the legacy documentation library, and an increasing number of new features are only accessible through Cocoa APIs. I would strongly suggest using Cocoa for your new application, instead of starting with Carbon then porting.