notes.txt 853 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. movecmd_t movecmd;
  2. input from
  3. packet sender
  4. wake up on alarms or input signal
  5. if on input signal, set skipnextalrm
  6. else
  7. if skipnextalarm
  8. skipnextalarm = false;
  9. continue;
  10. lock packet
  11. get current movecmd
  12. send message
  13. unlock packet
  14. packet receiver
  15. wake up only on packet arrival
  16. identify the packet source
  17. calculate exact latency
  18. save the packet off
  19. // cause timer messages to be issued
  20. SetTimer (mainwindow, 1, 50, NULL);
  21. // cause packet received messages to be issued
  22. WSAAsyncSelect ( net_socket, mainwindow, WM_USER, FD_READ );
  23. if (!GetMessage (&msg, NULL, 0, 0))
  24. {
  25. TranslateMessage (&msg);
  26. DispatchMessage (&msg);
  27. while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
  28. {
  29. if (!GetMessage (&msg, NULL, 0, 0))
  30. break;
  31. TranslateMessage (&msg);
  32. DispatchMessage (&msg);
  33. }
  34. PrepareToBlock ();
  35. }