what you mean with "I want to broadcast the connection,"?
what you try to do?
with the example port for CreateBroadcastListener, i get
a network name message, but i missing a send broadcast message command. the SendNetworkMessage appears only at GetNetworkMessage.
if i use BroadcastListener and hostnetwork or joinnetwork
and send with SendNetworkMessage it don't reach the other side ... ???
example i play with:
rem
rem AGK Application 1.08 B11
rem MR
rem Landscape App
SetDisplayAspect( 4.0/3.0 )
addvirtualbutton(2,10,50,10)
setvirtualbuttontext(2,"Host")
addvirtualbutton(3,20,50,10)
setvirtualbuttontext(3,"Client")
addvirtualbutton(1,30,50,10)
setvirtualbuttontext(1,"Send")
//id=CreateBroadcastListener(45631)
do
if netid
print("GetNetworkMessage : " + m$)
do
msg=GetNetworkMessage(netid)
if msg=0 then exit
m$=GetNetworkMessageString(msg)
DeleteNetworkMessage(msg)
loop
endif
if id
print("GetBroadcastMessage : " + br$)
do
msg=GetBroadcastMessage(id)
if msg=0 then exit
br$=GetNetworkMessageString(msg)
DeleteNetworkMessage(msg)
loop
endif
if getvirtualbuttonpressed(2)=1 and netid=0
netid=hostnetwork("myNetworkName","host",1025 )
endif
if getvirtualbuttonpressed(3)=1 and netid=0
netid=joinnetwork("myNetworkName","client")
endif
if getvirtualbuttonpressed(1)=1
if netid then Send(netid)
endif
if getpointerpressed()=1 then exit
Sync()
loop
if id
DeleteBroadcastListener(id)
id=0
endif
end
function Send(netid)
msg=CreateNetworkMessage( )
AddNetworkMessageString(msg,"Hello")
SendNetworkMessage(netid,0,msg)
endfunction