@@ -8,23 +8,24 @@ namespace cppnet {
8
8
// post sync read event.
9
9
int16_t SyncRead (const Handle & handle);
10
10
// post sync write event.
11
- int16_t SyncWrite (const Handle & handle, char * src, int32_t len);
11
+ int16_t SyncWrite (const Handle & handle, const char * src, int32_t len);
12
12
13
13
// post sync read event with time out
14
14
int16_t SyncRead (const Handle & handle, int32_t interval);
15
15
// post sync write event with time out
16
- int16_t SyncWrite (const Handle & handle, int32_t interval, char * src, int32_t len);
16
+ int16_t SyncWrite (const Handle & handle, int32_t interval, const char * src, int32_t len);
17
17
18
18
// post a sync task to io thread
19
19
int16_t PostTask (std::function<void (void )>& func);
20
20
#ifndef __linux__
21
21
// sync connection.
22
22
int16_t SyncConnection (const std::string& ip, int16_t port, char * buf, int32_t buf_len);
23
- #else
24
- int16_t SyncConnection (const std::string& ip, int16_t port);
25
23
#endif
26
- int16_t SyncDisconnection ();
24
+ int16_t SyncConnection (const std::string& ip, int16_t port);
25
+
26
+ int16_t SyncDisconnection (const Handle & handle);
27
27
28
+ int16_t Close (const Handle & handle);
28
29
}
29
30
30
31
#endif
0 commit comments