Using CMD Module with a Socket
<p>I've been having a hard time getting the CMD module to use a socket for stdin. Here is what I have :</p>

<pre><code>class Server(cmd.Cmd):
    use_rawinput = False 

    def __init__(self, port): 
        self.port = port
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.sock.bind(("", port))
        f = self.sock.makefile(mode='rw') 
        cmd.Cmd.__init__(self, stdin = f, stdout=sys.stdout) 


    def do_register(self, username):    
        print username
</code></pre>

<p>When I connect with the client and try the command <code>register user1</code>, I don't get anything on the server's console. </p>
