Re: [Dclib-devel] Dlib - server::kernel_1a_c unhandled exception
Brought to you by:
davisking
|
From: Davis K. <dav...@us...> - 2009-05-14 18:19:13
|
Are you declaring your server object at global scope? Doing that might
cause this problem if you are running windows and the WSACleanup() function
gets called before the server destructs itself. WSACleanup() basically
cleans up the winsock resources before the program ends. It gets called
when a certain global object is destroyed (take a look at line 74 in
sockets/sockets_kernel_1.cpp). But once it is called I would expect all the
sockets code to error out.
-Davis
2009/5/14 Martin Slováček <ma...@ve...>
> Hello Davis,
>
> I am using your (btw great) library in my diploma thesis. Recently, I have
> been facing a problem. I am using the server::kernel_1a_c object. The whole
> program runs correctly, but when exiting, I get an unhandled exception
> pointing me to the line 565 of server_kernel_1.h:
>
> throw dlib::socket_error(EOTHER, "error occurred in
> server_kernel_1::start()\nlistening socket returned error");
> The code I use to instantiate the object is as follows:
>
> theApp.getCtrlServer()->set_listening_port(CTRL_PORT);
> theApp.getCtrlServer()->set_max_connections(1);
> try{
> theApp.getCtrlServer()->start();
> }
> catch (std::exception& e)
> {
> cout << e.what() << endl;
> }
>
> Can you think of anything that could cause this?
>
> Thanks in advance,
>
> Martin Slovacek
>
|