After I studied. using chrome extension for application package that is better choice.
Actually, I created UPnP port map application. It was confirmed that P2P communication is possible.
Which network API shoud be used?
I'd think that you should useally use dart:io package, if create network application.
But, This way has problem. It could not use dart:html package with dart:io packge.This is dart library restriction. We can not create a GUI application simply. it's very inconvenient.
I thought that chrome extension api is used. chrome api has rich network api. and chrome api application convert other platform, ios , android and chrome book etc.
Necessary condition of P2P application.What is the condition to have to fill it as p2p application? It's able to communicate data directly between the terminals. It is a p2p definition, isn't it?
But, It's unexpected difficultly. The realization is difficult.
Router(NAT) interfere with direct connection.when we are accessing network, we must to use router? In the most cases, Router assinged local ip to our pc. this local ip address is different ip in outside.
IP addres us displayed such as "192.168.100.1" , "10.00.101.1" ,etc. this address is for private network. Event if tell this address to some person, It isn't possible to access. This ip address could be used in device with same the router.
Become connectable by UPnPRouter know global ip. you could be taught to the router!! Most of router has the ability to communicate at upnp protocol.
About UPnP PortmapUPnP protocol need udp and tcp socket.
- use udp multicast to know router address.
- use tcp to request router.
request port map
get global address
Let Implements!!- source
- sample app
Safely, communication between the terminals could confirm!! By using Dart & Chrome extension. I found out that P2P application can be made easily.
release HetimaPortMap in chrome store.
- Chrome Store
- Google Play(now testing version)