|Here is the procedure that is started as the new thread. It instantiates a class then runs the main method of that class.
unsigned int __stdcall Start_Server_As_Thread( void * p_void_pointer )
C_Server_Thread *mp_C_Server_Thread = NULL;
WCHAR m_log_file_text[ MAX_LOG_STRING_LENGTH ];
mp_C_Server_Thread = new C_Server_Thread( p_void_pointer );
mp_C_Server_Thread = NULL;
_endthreadex( 0 );
That class is declared as follows
The class it creates is declared:
Class C_Server_Thread manages all the overhead and communications between the main app and the thread. It instantiates C_TCP_API_Server, which does all the low level work of establishing a TCP/IP link with the client and sending the data.
Does that provide any useful information?
Edit: I continue to work this and am not certain where the problem is, but am becoming more certain that PEBKAC (Problem Exists Between Keyboard And Chair). It is looking more and more like a logic error in how I end this thing. Class C_Server_Thread could be in any of several states when it gets the event to exit. (Not connected to client, connected to client, sending data, etc) I need to work over the logic of what should be done for each state to ensure an orderly shutdown, not to mention complete shutdown.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
modified 27-Jun-14 21:26pm.