directly free the transport, not need to close for maybe NULL
正在显示
2 个修改的文件
包含
1 行增加
和
2 行删除
| @@ -218,8 +218,6 @@ void SrsHttpClient::kbps_sample(const char* label, int64_t age) | @@ -218,8 +218,6 @@ void SrsHttpClient::kbps_sample(const char* label, int64_t age) | ||
| 218 | void SrsHttpClient::disconnect() | 218 | void SrsHttpClient::disconnect() |
| 219 | { | 219 | { |
| 220 | kbps->set_io(NULL, NULL); | 220 | kbps->set_io(NULL, NULL); |
| 221 | - | ||
| 222 | - transport->close(); | ||
| 223 | srs_freep(transport); | 221 | srs_freep(transport); |
| 224 | } | 222 | } |
| 225 | 223 |
| @@ -217,6 +217,7 @@ public: | @@ -217,6 +217,7 @@ public: | ||
| 217 | * client.connect(); | 217 | * client.connect(); |
| 218 | * client.write("Hello world!", 12, NULL); | 218 | * client.write("Hello world!", 12, NULL); |
| 219 | * client.read(buf, 4096, NULL); | 219 | * client.read(buf, 4096, NULL); |
| 220 | + * @remark User can directly free the object, which will close the fd. | ||
| 220 | */ | 221 | */ |
| 221 | class SrsTcpClient : public ISrsProtocolReaderWriter | 222 | class SrsTcpClient : public ISrsProtocolReaderWriter |
| 222 | { | 223 | { |
-
请 注册 或 登录 后发表评论