# 4.2.1 命名空间 namespace

表示在由路径名标识的给定作用域下连接的socket池（例如：`/chat`）。

客户端总是连接到`/`（主命名空间），然后可能连接到其他命名空间（同时使用相同的基础连接）。

关于如何以及为什么，请看一下：[房间(room)和名称空间(Namespace)](https://socket.io/docs/rooms-and-namespaces/)。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://socket.gitbook.io/docs/4-fu-wu-duan-apiserverapi/4.2-ming-ming-kong-jian-namespace/namespace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
