instance has no attribute 'sock'
Question: I have a basic server program running in Python using Twisted. I am trying to
reject a user and am trying to use `self.sock.close()`. When that line gets
called I get an exception:

> AttributeError: IphoneChat instance has no attribute 'sock'.

This is strange because before this line of code was executing and not causing
an exception:

    
    
    from twisted.internet.protocol import Protocol, Factory
    from twisted.internet import reactor
    class IphoneChat(protocol):
       def connectionMade(self):
          self.sock.close()
          return
    

That is it right now I changed it when i was trying to reject a incoming
connection.


Answer: self.transport.loseConnection() is another way to do self.sock.close() when
using twisted. I can not figure out why it was working and then stopped
working.

