MBS Xojo Plugin Tutorial Videos
Bonjour Source
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /kunden/macsw.de/webseiten/monkeybreadsoftware-video/rbformat/rbcode.php on line 244
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class
Class Window1
Inherits Window
// Controls
ControlInstance
End ControlInstance
// Properties
Dim browser As MyBrowser
Dim Lookups(-1) As MyLookup
// Event implementations
Sub Open()
StartBrowse
End Sub
// Methods
Sub StartBrowse()
browser=new MyBrowser
if browser.Browse(0,"_afpovertcp._tcp","") then
// ok
else
Listbox1.AddRow "Failed"
end if
End Sub
Sub StartLookup(name as string, typ as string, domain as string, listboxindex as integer)
dim l as new MyLookup
l.ListboxIndex=listboxindex
if l.Lookup(0,name,typ,domain) then
// ok
else
listbox1.cell(listboxindex,1)="failed"
end if
Lookups.Append l
End Sub
End Class
Class MyBrowser
Inherits DNSServiceBrowseMBS
// Event implementations
Sub ServiceBrowse(Flags as integer, InterfaceIndex as integer, ErrorCode as integer, ServiceName as string, RegType as string, Domain as string)
const kDNSServiceFlagsAdd=2
dim f as integer
f=BitwiseAnd(flags, kDNSServiceFlagsAdd)
if f<>0 then // added
window1.ListBox1.AddRow ServiceName
window1.StartLookup ServiceName, RegType, domain, window1.ListBox1.LastIndex
else
// removed
end if
End Sub
End Class
Class MyLookup
Inherits DNSServiceResolveMBS
// Properties
Dim ListboxIndex As Integer
// Event implementations
Sub ServiceLookup(flags as integer, InterfaceIndex as integer, ErrorCode as integer, Fullname as string, Hosttarget as string, Port as integer, TxtRecord as string)
window1.ListBox1.Cell(ListboxIndex,1)=DNSNameToAddressMBS(Hosttarget)+":"+str(port)
window1.ListBox1.cell(ListboxIndex,2)=Hosttarget
End Sub
End Class
Links
MBS FileMaker tutorial videos