wangzhengquan
2020-10-10 9ebe80228c7b7cb35ccaeaaa46ccf726bf71d6bd
src/socket/net_mod_socket.c
@@ -1,5 +1,6 @@
#include "net_mod_socket.h"
#include "socket_io.h"
#include "net_mod_socket_io.h"
NetModSocket::NetModSocket(const char *host, int port) 
{
@@ -12,10 +13,11 @@
ssize_t NetModSocket::send(void *buf, size_t size) {
  int n = rio_writen(clientfd, buf, size);
  rio_writen(clientfd, PKG_SEP, strlen(PKG_SEP));
  char resp[MAXLINE];
  int ss;
  ss = rio_readlineb(&rio, resp, MAXLINE);
  ss = rio_readpkgb(&rio, resp, MAXLINE);
  puts(resp);
  return n;
}