Hello! There is WServer::instance() method.
On Mon, Sep 3, 2012 at 2:38 PM, Neil D'Souza <nxd...@yahoo.com> wrote: > Hello All, > > Is there any way to access the Wt::WServer from inside the WApplication? > > Currently, below is what I am doing, but i dont think this is very neat > and there might be a better way, or something I missed in the documentation > In the WApplication class. > > Wt::WServer server; > Wt::WApplication *createApplication(const Wt::WEnvironment& env) > { > return new HelloApplication(env, false, server); > } > > Wt::WApplication *createWidgetSet(const Wt::WEnvironment& env) > { > return new HelloApplication(env, true, server); > } > > Why do I need this? > I need a dynamic port number for a wt exe application which I launch after > compiling it through a web interface. I searched for documentation on this > and found that if you pass 0 to the port number, the OS will allocate you a > port number dynamically. This works with the Wt executeable. > > Once this is done , I wish to print the port number (capture it in some way) > and create a URL which points to where the application is running, so that > users can visit it. > > I am able to do all of the above, but just wanted to know if there is a > neater way of doing this i.e. avoiding the global variable. > > Thanks, > Neil > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > witty-interest mailing list > witty-interest@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/witty-interest > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest