B4J Code Snippet [server] listen to an additional http port

B4X:
Private Sub AddHttpPort(port As Int)
    Dim server As JavaObject = srvr.As(JavaObject).GetField("server")
    Dim Connector As JavaObject
    Connector.InitializeNewInstance("org.eclipse.jetty.server.ServerConnector", Array(server))
    Connector.RunMethod("setPort", Array(port))
    server.RunMethod("addConnector", Array(Connector))
End Sub

Call it before calling srvr.Start.
Depends on JavaObject.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…