Skip to content

Commit f62e777

Browse files
authored
Merge pull request #110 from laneysmith/patch-1
Update API.md
2 parents d0a846e + 74c61ea commit f62e777

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

API.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
## API
22
### *Overview*
3-
There're just 3 roles in this library - `socket`,`client` and `message`.
3+
There're just 3 roles in this library - `socket`, `client` and `message`.
44

5-
`client` is for physical connection while `socket` is for "namespace"(which is like a logical channel), which means one `socket` paired with one namespace, and one `client` paired with one physical connection.
5+
`client` is for physical connection while `socket` is for "namespace" (which is like a logical channel), which means one `socket` paired with one namespace, and one `client` paired with one physical connection.
66

7-
Since a physical connection can have multiple namespaces (which is called multiplex), a `client` object may have multiple `socket` objects, each is bind to a distinct `namespace`.
7+
Since a physical connection can have multiple namespaces (which is called multiplex), a `client` object may have multiple `socket` objects, each of which is bound to a distinct `namespace`.
88

99
Use `client` to setup the connection to the server, manange the connection status, also session id for the connection.
1010

1111
Use `socket` to send messages under namespace and receives messages in the namespace, also handle special types of message.
1212

13-
The `message` is just about the content you want to send, with text,binary or structured combinations.
13+
The `message` is just about the content you want to send, with text, binary or structured combinations.
1414

1515
### *Socket*
1616
#### Constructors
@@ -28,7 +28,7 @@ Universal event emition interface, by applying implicit conversion magic, it is
2828

2929
`void on(std::string const& event_name,event_listener_aux const& func)`
3030

31-
Bind a callback to specified event name. Same as `socket.on()` function in JS, `event_listener` is for full content event object,`event_listener_aux` is for convinience.
31+
Bind a callback to specified event name. Same as `socket.on()` function in JS, `event_listener` is for full content event object, `event_listener_aux` is for convenience.
3232

3333
`void off(std::string const& event_name)`
3434

@@ -132,7 +132,7 @@ Set listener for socket close event, called when any sockets being closed, after
132132
#### Connect and Close
133133
`void connect(const std::string& uri)`
134134

135-
Connect to socket.io server, eg. `client.connect("ws://localhost:3000");`
135+
Connect to socket.io server, e.g., `client.connect("ws://localhost:3000");`
136136

137137
`void close()`
138138

0 commit comments

Comments
 (0)