'for connection based decoders
close and discard the connection object'

def close(self, conn, ts=None):

    if (conn.state == 'closed'):
        return
    conn.state = 'closed'
    if ts:
        conn.endtime = ts
    if (not conn.stop):
        if (self.isBlobHandlerPresent and conn.blobs):
            self.blobHandler(conn, conn.blobs[(-1)])
        if self.isConnectionHandlerPresent:
            self.connectionHandler(conn)
    if ('connectionCloseHandler' in dir(self)):
        self.connectionCloseHandler(conn)
    if (conn.addr in self.connectionsDict):
        del self.connectionsDict[conn.addr]
