WhiskerTestClient

Top  Previous  Next

You can use this program to communicate with the server manually. It does incredibly little but is a handy programming and test tool nonetheless.

 

WhiskerTestClient

 

Connecting to the server. First, you need to choose a server and click Connect. The default server address is 'loopback' (or 127.0.0.1), which is computer-speak for 'this machine'. To communicate with WhiskerServer when it is running on another machine, enter that machine's IP address – the address that looks like 'somewhere.psychol.cam.ac.uk'. The default port number is 3233; you probably won't need to change this.

 

Sending commands. You can type into the box marked 'Message' and click Send (or press Enter). Click the drop-down arrow to see a list of commands that the server should recognize.

 

Have a play. Try claiming an input line, requesting an event on it, and playing with the sensor it's connected to. Try claiming an output line and setting its state. (The commands to perform these tasks are described fully later; see the Programmer's Guide.) Explore the server console at the same time. Try enabling the communication logs for client you are using. You'll be able to find a log of everything that occurred, and be able to watch the lines and events fly back and forth.

 

Every message you send is shown in the window labelled 'Sent'. Messages that come back from the server, plus a few status messages from the program itself, are shown in the box labelled 'Received'. Any messages that come from the server and begin with 'Event:' are shown in the 'Events' window, with the event prefix removed.

 

You can type in (or copy/paste in) a further set of messages into the Ready Message boxes, and send them rapidly, either by clicking the buttons "Send 1" to "Send 4", or by pressing Alt-1 to Alt-4.

 

Click Clear event history to wipe the slates clean.

 

Technical note

TechNote_MagnifyingGlass

Using an immediate socket system with this client requires that you fire up a second copy, using a different port number. This program hides almost nothing from you - useful for learning how the system is put together, if you like that sort of thing.

 

The client was written in Visual C++ as a dialogue-based application. It does not use the client library that was used to develop the behavioural tasks. It is a derivative of the first Windows socket-based program written as part of the Whisker project. It's done well.