summaryrefslogtreecommitdiff
path: root/utils/vmpi/net_view_thread.h
blob: 4de4406509a809da5ee58b88a20e2ac8223d93db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#ifndef NET_VIEW_THREAD_H
#define NET_VIEW_THREAD_H
#ifdef _WIN32
#pragma once
#endif


#include "utlvector.h"


class CNetViewThread
{
public:
	CNetViewThread();
	~CNetViewThread();

	// This creates the thread that periodically checks "net view" to get the current list of
	// machines out on the network.
	void Init();
	void Term();
	
	void GetComputerNames( CUtlVector<char*> &computerNames );

private:

	void UpdateServicesFromNetView();
	void ParseComputerNames( const char *pNetViewOutput );
	
	DWORD ThreadFn();
	static DWORD WINAPI StaticThreadFn( LPVOID lpParameter );

	CUtlVector<char*> m_ComputerNames;
	HANDLE m_hThread;
	HANDLE m_hThreadExitEvent;
	CRITICAL_SECTION m_ComputerNamesCS;
};


#endif // NET_VIEW_THREAD_H