iOS socket list of hosts wlan - ios

I have some WLAN-Device, that I communicate with.
At first I go to IOS Settings and connect to the device directly.
Then in my App I need to input the ip and port to open a socket.
Until now I knew the IP and Port, to open a socket connection to this device.
But if I am already connected (Adhoc) to the device, why I can not find this stuff automatically?
I already saw some solutions, but most of them need the usage of dynamic libs or just not longer available in iOS7.1. I can not use dynamic libs, because this App should go to AppStore.

There is no other way since iOS 6.
You have to scan the location. "Reachability" could help you, if you know the name of the host. Also you could try to scan the posible IP's. With Thread limited by 5 Operations it could go preaty fast.

Related

Read/Write between Mac and iPhone using libusbmuxd

I current use libimobiledevice to work around Mac and iPhone. libusbmuxd is very helpful to get device (iPhone/iPad) information when connects to Mac app through USB.
I want more, I want to read/write data (a file like document, image, video, ...) from Mac to iPhone and vice versa but I can't get any document or tutorial on the Internet guiding how to do it.
Can anyone help me
If you want to transmit data between OSX and iOS via usbmuxd it is basically a two step process:
Start a socket server on an arbitrary port on iOS or tvOS
Open a socket connection to the usbmuxd server on OSX at /var/run/usbmuxd.
After you have done that you will receive some control messages from the usbmuxd server on OSX including events for device attach and detach. Each device that has been attached to the usbmuxd server has a unique device id. This device id in combination with the port of the socket server can be used to bind the socket connection to the socket server.
If you want to save yourself the trouble of implementing this procedure from scratch you can have a look at the following frameworks. They both provide a high level API in Objective-C.
https://github.com/rsms/peertalk
https://github.com/jensmeder/DarkLightning
this is actually quite easy.
Have a further look at https://github.com/libimobiledevice
Especially look at the iFuse example.
libusbmuxd is a library to use the usbmuxd, which tunnels any socket connections on the iOS device over USB to a local socket.
On every iOS device you can find an open socket on port 62078. This is the so-called lockdownd, which is used for many things.
With lockdownd you can start the AFC service (Apple File Conduit), which is a network filesystem service.
libimobiledevice does all of this for you. (Look at libimobiledevice/afc.h, here are all filesystem related functions like reading a file, retrieving a directory, etc.)
Things you have to do:
call lockdown_client_new_with_handshake(..)
call lockdownd_start_service(..) with the "com.apple.afc" service
if your device is jailbroken, you get full filesystem access with the "com.apple.afc2" service, but otherwise the standard service should do well.
By the way: The lockdownd connection works only if your device is unlocked.
Ciao, Arno

Change the IP Address on iPhone by using code

My app has to connect to a server which can redistribute a new IP Address for the iOS client device.
How to change the IP Address on iPhone by using code in my app?
The app will not be published on the app store and the iOS devices may be jailbroken if necessary.
Anyone can give some suggestion on coding?
You cannot change ip address with the non-private frameworks that you are allowed to use.
You have to find a different architecture for your server-client communication if you want your app to be published on the app store.
From Apple Documentation : iOS is using DHCP(Dynamic Host Configuration Protocol) protocol. So As per DHCP manual IP settings are not allowed by coding.
To learn more about DHCP read This.

Configure iPad IP address programmatically

I have a requirement where the iPad application must configure the IP address of the device to a particular IP and connect to a wireless network. I had gone through the internet but could not find any material regarding the possible solution .
I really appreciate any solution on this
Thank you
Unfortunately, an iOS app doesn't have this control over the system, so this can't be done on an App Store app.

BlackBerry simulator settings for VPN

I want to test a project from the BlackBerry simulator, but our webservice runs on an external server that can only be accessed using the vpn from our PC's.
I can access the webservice from the Android simulator without doing anything special. However I cannot access the webservice from the BlackBerry simulator -- not even from the browser of the simulator -- though I am able to connect to other services on the web from the BlackBerry simulator.
What kind settings are there to fix this?
There's a network setting for the simulator that might be useful for situations like this. You could try manually assigning the vpn ip address you were given.
/ip-address={string}
IP address of the simulated handheld. This should be left blank under normal circumstances. If running on a PC with multiple IP addresses, one can be specified here to cause the simulator to use it.
Cheers
Ray
Ok...anyone bumping on the same problem...
Append ";deviceside=true" to the URL from which data is to be fetched

Unable to make direct TCP connections on blackberry application

In my blackberry application I'm establishing network connection by appending ;deviceSide=true in the url. It is working fine on simulator but its not working on device. I've correct APN settings as other third party apps are running fine.
Please let me know the possible reason for this issue!!!
Its not necessary that your app always connect via direct TCP.
For taking care all types of networks available in blackberry for your app refer this article.
How to programmatically connect to the internet in blackberry
Network Diagnostic Tool
download this network diagnostic tool developed by RIM and check weather direct TCP is working or not in your mobile.

Resources