Home/Support/Support Forum/Connect ME -C resrting of HTTP server after reconfiguring
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Connect ME -C resrting of HTTP server after reconfiguring

0 votes
I have an app that needs to start the HTTP server. Once the app receives a new IP address and port number for the http server, I need to restart it with the new settings. My code uses a call to naHSDefaultSetting() to get the server settings, which I modify with the port number. Then I call NAHSStartServer() to start the server. This works good for the initial startup, but once I have my new IP address and port number, I have only managed to find a way to release the IP using naIamRelease(). I do not see a way to change the port assignemnt for the HTTP server and then restart it. NAHSStartServer() has no effect if called again after the server is already started. Does anyone know how I can get around this?
I am also having the same issue with the telnet server, starting it with a defined port and then being able to change the port later.
asked Mar 19, 2009 in NET+OS by rflach5 New to the Community (7 points)
recategorized Dec 18, 2013 by tuxembb

Please log in or register to answer this question.

3 Answers

0 votes
By the way, I am using NET+ OS 7.2
answered Mar 19, 2009 by rflach5 New to the Community (7 points)
0 votes
Unfortunately, relative to what you want to do, there are no supported methods for stopping and then restarting the web server. The port selected at start time is (in the socket parlance) bound to INADDR_ANY and the web server waits for connections on your selected port number - default 80. So changing your device's IP address is of no consequence. But since the port is bound to the socket, that can not be changed without deleting and recreating the web server's socket. Which back to my initial statement is not supported.
answered Mar 19, 2009 by sparkys_dad Community Contributor (99 points)
0 votes
So then my best bet is proably what I implemented: I start a serial thread that waits for the Ethernet connection settings from my serial device. Once aquired, I start my http server and telnet server with the desired ports. To change the settings, I require the user to power down the device so that I can start this process again with the new serial provided parameters.
answered Mar 19, 2009 by rflach5 New to the Community (7 points)
...