# 4.2.7 命名空间发送事件参数 namespace\_emit\_eventname\_args

* `eventName` (String)
* `args`

向所有连接的客户端emit事件,以下方法两个是等同的：

```javascript
const io= require('socket.io')();
io.emit('an event send to all connected clients'); //主命名空间

const chat = io.of('/chat');
chat.emit('an event send to all connected clients in chat namespace');
```

**注意**:从命名空间发出时不支持确认。


---

# 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_emit_eventname_args.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.
