aboutsummaryrefslogtreecommitdiffstats
path: root/QW/client/notes.txt
blob: 637487c7eb5a4dcebb6293194fde0fbf966f277b (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
46
47
48


movecmd_t	movecmd;


input from 

packet sender
	wake up on alarms or input signal
	if on input signal, set skipnextalrm
	else
		if skipnextalarm
			skipnextalarm = false;
			continue;
	lock packet
	get current movecmd
	send message
	unlock packet

packet receiver
	wake up only on packet arrival
	identify the packet source
	calculate exact latency
	save the packet off




	// cause timer messages to be issued
	SetTimer (mainwindow, 1, 50, NULL);

	// cause packet received messages to be issued
	WSAAsyncSelect ( net_socket, mainwindow, WM_USER, FD_READ );	

	if (!GetMessage (&msg, NULL, 0, 0))
	{
		TranslateMessage (&msg);
		DispatchMessage (&msg);
		while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
		{
			if (!GetMessage (&msg, NULL, 0, 0))
				break;
			TranslateMessage (&msg);
   			DispatchMessage (&msg);
		}
		PrepareToBlock ();
	}