This should work, but regardless of that. SDK and arming is not reliable. What you should do is either create TCP server or HTTP server yourself and use HTTP Listening mode. This way you are not risking of having fail to arm, or arm stuck mode.