### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- API »
- The PyZMQ API »

# core.context

## Module: `core.context`

Inheritance diagram for `zmq.core.context`:

0MQ Context class.

## `Context`

class `zmq.core.context.``Context`(io_threads=1)

  Bases: `object`

  Manage the lifecycle of a 0MQ context.

  This class no longer takes any flags or the number of application threads.

  Parameters : | io_threads : int The number of IO threads.

  `closed`
  `socket`(socket_type)

    Create a Socket associated with this Context.

    Parameters : | socket_type : int The socket type, which can be any of the 0MQ socket types: REQ, REP, PUB, SUB, PAIR, XREQ, XREP, PULL, PUSH, XSUB, XPUB.

  `term`()

    Close or terminate the context.

    This can be called to close the context by hand. If this is not called, the context will automatically be closed when it is garbage collected.

### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- API »
- The PyZMQ API »