B4J Question how to close Jetty server, end rest api process

hookshy

Well-Known Member
Licensed User
Longtime User
Hi,
If i have also a UI that runs jetty in background how do i end up the rest api server when the user closes the activity window ?

I can use this code but did not found any information about end up the process server programaticaly.
I can find the process with windows tools but yet don't want to do this manually.
B4X:
Sub MainForm_CloseRequest (EventData As Event)
    EventData.Consume
    
    
    Dim sf As Object = xui.Msgbox2Async("Close Server?", "Server", "Yes", "Cancel", "No", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        'save changes
        'close server
        
    End If
    If Result <> xui.DialogResponse_Cancel Then
        MainForm.Close
    End If
    
End Sub

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Jetty exptects to run in a neverending nonUI App.
 
Upvote 2

hookshy

Well-Known Member
Licensed User
Longtime User
I used a UI and jetty works !!! ...i not that it is very upset to have such
Only reason i have do that is to pack as exe more easy using the option project build stand alone package.

So if i make non UI app , which is not too dificult , i will close the jetty from the processes or using command prompt ?
 
Upvote 0
Top