Skip to content

Commit 757e378

Browse files
committed
improve README format
1 parent c1005ad commit 757e378

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ By virtue of being written in C++, this client works in several different platfo
1212
- Compatible with 1.0+ protocol
1313
- Binary support
1414
- Automatic JSON encoding
15+
- Multiplex support
1516
- Similar API to the Socket.IO JS client
1617

1718
## How to use
@@ -68,8 +69,8 @@ void OnMessage(sio::event &)
6869
{
6970
7071
}
71-
7272
h.socket()->on("new message", &OnMessage);
73+
7374
/********************* bind with lambda ********************/
7475
h.socket()->on("login", [&](sio::event& ev)
7576
{
@@ -154,30 +155,29 @@ Bind the error handler for socket.io error messages.
154155
Unbind the error handler.
155156
156157
```C++
157-
158-
//event object:
159-
class event
160-
{
161-
public:
162-
const std::string& get_nsp() const;
163-
164-
const std::string& get_name() const;
165-
166-
const message::ptr& get_message() const;
167-
168-
bool need_ack() const;
169-
170-
void put_ack_message(message::ptr const& ack_message);
158+
//event object:
159+
class event
160+
{
161+
public:
162+
const std::string& get_nsp() const;
163+
164+
const std::string& get_name() const;
165+
166+
const message::ptr& get_message() const;
167+
168+
bool need_ack() const;
169+
170+
void put_ack_message(message::ptr const& ack_message);
171+
172+
message::ptr const& get_ack_message() const;
173+
...
174+
};
175+
//event listener declare:
176+
typedef std::function<void(const std::string& name,message::ptr const& message,bool need_ack, message::ptr& ack_message)> event_listener_aux;
171177
172-
message::ptr const& get_ack_message() const;
173-
...
174-
};
175-
//event listener declare:
176-
typedef std::function<void(const std::string& name,message::ptr const& message,bool need_ack, message::ptr& ack_message)> event_listener_aux;
177-
178-
typedef std::function<void(event& event)> event_listener;
179-
180-
typedef std::function<void(message::ptr const& message)> error_listener;
178+
typedef std::function<void(event& event)> event_listener;
179+
180+
typedef std::function<void(message::ptr const& message)> error_listener;
181181
182182
```
183183

examples/QT/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Make up a simple ui by drag and drop widget from `Widget box` in left side.
8787

8888
We finally end up with this:
8989

90-
![QT mainwindow](https://cldup.com/T4oUpiQFV7.jpg)
90+
![QT mainwindow](https://cldup.com/RI98CYpYL5.png)
9191

9292
It contains:
9393

0 commit comments

Comments
 (0)