Online peer to peer connection - iphone

Here i am developing an application which uses peer to peer connection. i am able to communicate using WIFI and Bluetooth connection. i.e a devices with in a same local network are able to communicate with each other.
Is it possible to communicate online using Bonjour service or any other option for online communication.
Please help me...

Bonjour works only in the local network, because the devices communicate via multicast
DNS (IP: 224.0.0.251). You could use Wide Area Bonjour with the cooperation of a DNS server.
Under http://www.dns-sd.org/ServerSetup.html you find a description how to set that up on Unix.
Other than that I don't think there is any special support by Apple. You have to set up some kind of server on the Internet yourself.

Related

How to find IP addresses of devices on local network which are running an instance of my app in Swift?

I'm working on a simple Swift app where one user can find other machines on a local network which are running an instance of my app and then send data to that machine using TCP sockets.
My question is how to find IP addresses of devices on same network which are running an instance of my app (cross-platform)?
I was thinking about listing all devices on local network and then
checking whether they have opened specific port (the port my app is
using)?
I also found that Apple provides service called Bonjour which could make my process discoverable. I'm not sure if this solution is good for cross-platform communication.
Apart of Mac-related stuff and high-level solutions (I believe keywords "network service discovery" will bring you to them), there are a couple of things that will work for a local network:
I Have a server that clients should report to. Some short hello-like UDP message and a timeout mechanism will be sufficient to keep a list of available clients in the network.
II Use IP or UDP multicast groups to notify others that a client has just connected to the network. Send a message to a multicast group and listen to this group to build a list of clients.
However, broadcasts and multicasts won't be transmitted through a router. So if your network is large enough only neighbouring clients will hear your notification. In order to overcome it,
III DHCP servers can be configured to provide custom data to clients via unassigned DHCP options. Large networks have usually such server. You probably can use it to send out a list of clients, but I'm not sure about this.

Modem Over IP or VOIP?

I need to connect to a remote server via a modem for a legacy app. I don’t have physical access to my server so adding a real modem isn't an option.
Does anyone know of:
A service that provides Modem Over IP? Something like Twilio, but just for modems.
A modem / SIP client that would allow me to emulate a modem on a specific COM port that connects to a VOIP provider?
Any advice would be greatly appreciated. I see quite a few people with this problem, but no great solutions.
Thanks!
Steve
I think what you are looking for is PPP (or maybe PPPoE). PPP is very common and is still used heavily today pretty much everywhere you have a home connected internet connection.
You need to look at whatever OS you are using and see what they provide to be able connect two computers via a modem and create a TCP/IP connection between them. That way you don't need to change your program, as it will showup as a network connection.
Under windows you have this for accepting incoming connections.

Redirect telnet 23 to COM Port via WIFI

I bought an Bluetooth ELM327 to read codes out of my cars diagnostic ports
I connect to it via Bluetooth in windows and it makes a serial-over-bluetooth com port 4
which any application running on my windows will connect quite happily.
I then found a few apps for the iphone and android etc that connect to these ELM gadgets via WIFI and not Bluetooth (because for some reason you cannot pair to these devices of iphone)
Now obviously I can buy a WIFI enabled ELM327 - but it costs £130 and my Bluetooth one cost £15
So after reading about this a bit I found out that the WIFI enabled ones you connect up as ad-hoc network and the smartphone(iphone) app tenets in port 23 that relays normal serial commands.
So obviously in the WIFI enabled one there must be some processor that runs an nano-os with telnet and some rs-323 translators and not sure what else.
How, using Windows 7 will i be able to relay any incoming WIFI requests for Telnet port 23 to my COM 4 that is connected to my Bluetooth ELM327 ..
As this is surely all that is needed by the Smartphone app.
You dont have to connect using a Bluetooth library like suggested ... because you are already connected to the device and have COM4 exposed to you. SO all you have todo is use a telnet library and translate and handle the handshake then realy the infomation as serial data.
There's no feature built in to Windows (or any other platform I know of) for such a scenario.
It would be fairly straightforward however to write a program to listen on port 23 and open a bluetooth connection when connected to, and then forward the data received on each connection out onto the other.
For instance one could use my .NET library 32feet.NET (e.g. http://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections etc etc) along with TcpListener from the .NET framework class libraries.

what is Bonjour?

I was watching wwdc videos this afternoon and I heard the word Bonjour .
So I just want to know what is Bonjour in Apple .
This is just to clear the concept .
Thanks
In computing, Bonjour (formerly Rendezvous1) is Apple Inc.'s trade name for its implementation of Zeroconf, a service discovery protocol. Bonjour locates devices such as printers, other computers, and the services that those devices offer on a local network using multicast Domain Name System service records.
More about Bonjour at Wikipedia ...
Apple's Bonjour FAQ
Macs (OSX 10.4+) come installed with dns-ds, which is a
dns-sd -- Multicast DNS (mDNS) & DNS Service Discovery (DNS-SD) Test Tool
Zero configuration networking (zeroconf), is a set of techniques that automatically creates a usable Internet Protocol (IP) network without manual operator intervention or special configuration servers.
Zero configuration networking allows inexpert users to connect computers, networked printers, and other network devices and expect a functioning network to be established automatically. Without zeroconf, a user must either set up special services, like Dynamic Host Configuration Protocol (DHCP) and Domain Name System services (DNS), or set up each computer's network settings manually, which may be difficult or impossible for non-technical or novice users.
More about zeroconf ...

Peer to peer over 3G

Hey I'm trying to get a CFStream connection going over 3G. I can get it working over wifi using the host name, but when I try to connect directly to the ip address it fails.
Is there a guide out there on how to connect over 3G?
Thanks
ASH
You can use NAT traversal in some cases. This is not a guaranteed method and depends on the type of NAT so you will still need a relay server if you want to guarantee connectivity.
A general rule is if both clients are behind symmetric NATs then a relay server is required.
If only one NAT is symmetric then STUN, ICE, methods can be helpful in establishing P2P connections.
The following might help you:
Interactive Connectivity Establishment see en.wikipedia.org/wiki/Interactive_Connectivity_Establishment
PJNATH Open source project for NAT traversal in SIP/VoIP solutions see PJSIP.ORG
When you are connected to 3G then you are usually behind a router that implements some 'NAT' scheme. This means that your iPhone gets a private internal IP address on the inside (the 3G network) and a shared 'real' public IP address on the outside (the Internet).
This is all fine when you are just a client connecting to services on the Internet, but it will fail horribly when you try to connect to other clients in the same situation.
There is no simple solution for this. Programs like Skype work around this problem by using intermediate servers with public IP addresses that can relay network traffic between hosts behind such 'NATted' networks.