Skip to content

Server side

Peter Foot edited this page Mar 31, 2017 · 1 revision

OBEX Server-side

Is also supported. Use code like the following.

{code:vb.net} Dim lsnr As New ObexListener(ObexTransport. Bluetooth) lsnr.Start() ' For each connection Dim ctx As ObexListenerContext = lsnr.GetContext() Dim req As ObexListenerRequest = ctx.Request Dim pathSplits() As String = req.RawUrl.Split('/') Dim filename As String = pathSplits(pathSplits.Length - 1) req.WriteFile(filename) ' lsnr.Stop() {code:vb.net} {code:c#} var lsnr = new ObexListener(ObexTransport.Bluetooth); lsnr.Start(); // For each connection ObexListenerContext ctx = lsnr.GetContext(); ObexListenerRequest req = ctx.Request; String pathSplits = req.RawUrl.Split('/'); String filename = pathSplitspathSplits.Length - 1; req.WriteFile(filename); // lsnr.Stop(); {code:c#}

See also the DesktopListener and DeviceListener sample programs.

See also One Active Server

Clone this wiki locally