We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我看过了 #59 这个issue中的描述,有以下代码:
void connect_tcp_send(hloop_t* loop, char* ip, int port, char* message) { hio_t* client = hloop_create_tcp_client(loop, ip, port, on_connect, on_tcp_close); hio_write(client, message, strlen(message)); hio_close(client); }
希望达到的效果是,建立连接,发送message,然后立马断开连接。 但是实际上这样调用是做不到的,或者说是不能每次都把message发到服务端的,只有在on_connect中执行hio_write才可以,而且执行hio_write后,还不能立马调用hio_close,不然还是会收不到。按照 #59 的描述,应该是可以的,不知道是不是我哪里写错了?
message
on_connect
hio_write
hio_close
The text was updated successfully, but these errors were encountered:
TCP客户端,需要在连接上以后才能开始发送数据,也就是on_connect回调通知你已经连接上了。
Sorry, something went wrong.
No branches or pull requests
我看过了 #59 这个issue中的描述,有以下代码:
希望达到的效果是,建立连接,发送
message
,然后立马断开连接。但是实际上这样调用是做不到的,或者说是不能每次都把
message
发到服务端的,只有在on_connect
中执行hio_write
才可以,而且执行hio_write
后,还不能立马调用hio_close
,不然还是会收不到。按照 #59 的描述,应该是可以的,不知道是不是我哪里写错了?The text was updated successfully, but these errors were encountered: