NetGroup not working for LAN communication on AIR iOS apps from AIR 3.5 on
help!
trying upgrade app ios 7.
i'm using following code communicate between air ios apps within lan.
it works air 3.2 not air 3.5-3.9...
no error message, not able receive data netgroup.
any suggestions on lan communications appreciated
public function p2p_post(_message:function=null) {
//connect;
if (_message!=null) {
func = _message;
}
nc = new netconnection();
nc.addeventlistener(netstatusevent.net_status, netstatus);
nc.connect("rtmfp:");
}
private function connect():void
{
}
private function netstatus(event:netstatusevent):void
{
switch(event.info.code)
{
case "netconnection.connect.success":
setupgroup();
break;
case "netgroup.connect.success":
this.dispatchevent(new event("connect_success"));
break;
case "netgroup.posting.notify":
if(func!=null){
func(event.info.message);
}
break;
case "netgroup.neighbor.connect":
trace("netgroup.neighbor.connect");
case "netgroup.neighbor.disconnect":
break;
}
}
private function setupgroup():void
{
trace("setupgroup;");
var groupspec:groupspecifier = new groupspecifier("mygroup/ipad2flash_server");
groupspec.postingenabled = true;
groupspec.ipmulticastmemberupdatesenabled = true;
groupspec.addipmulticastaddress(datainstance.getinstanse().ip_group);
group = new netgroup(nc,groupspec.groupspecwithauthorizations());
group.addeventlistener(netstatusevent.net_status,netstatus);
}
public function postobject(obj:object,_type:string) {
var message:object = new object();
message.obj = obj;
message.type = _type;
message.random = new date().time;
message.sender = group.convertpeeridtogroupaddress(nc.nearid);
group.post(message)
}
More discussions in AIR Development
adobe
Comments
Post a Comment