What you want is described in the Python Sockets HOWTO in the documentation. Here's the Python 2 version:
http://docs.python.org/2/howto/sockets.html
The short version is that the code you posted is a simple server that is configured to respond to requests from a separate process, possibly on a different machine, that sends a small chunk of data to it. This server sends back the data with a time stamp in front.
socket.listen() is used to set up a socket to receive incoming connections. The connection requests go into a short queue and are handled in order. socket.accept() checks to see if there's an incoming connection in that listen queue, and if so, it opens up a new socket to the other machine just to handle that one connection. When the connection ends, the new socket to the first client closes and the server socket moves on to the next connection in the queue to handle it.
To make this server do anything, you'd need to use some client program to open the correct port and send a message to it. For something this simple, you might try using telnet if it's installed on your machine. Run this server, then try:
telnet localhost 21567
on the same machine and start typing some text. You should see responses. My output looked like this:
$ telnet localhost 21567
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
j
[Sun Sep 15 11:58:27 2013] j
jkl
[Sun Sep 15 11:58:29 2013] jkl
fdjksla;
[Sun Sep 15 11:58:30 2013] fdjksla;
fdjkasl;fjdksal;fjkdsa;
[Sun Sep 15 11:58:32 2013] fdjkasl;fjdksal;fjkdsa;
NOTE: You will have to put a hostname into your HOST field for this to work. Try 'localhost' and see if that helps. Also, I believe if you use localhost as your HOST parameter you may not be able to receive connections from other machines. In that instance, you'll need to use your own local hostname or IP address on the network.
I've edited the OP with fixed indenting and 'localhost' for the HOST parameter, and tested that this works with telnet in another shell as I've described here.
I notice also that this code never reaches the close() for the server socket. You'd want a break somewhere in your outer while loop if you wanted to close your server and exit in an orderly way.