C ++套接字对在写入后无法读取
我有一个插座对:
int fds[2];
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fds) < 0) {
throw string("socketpair failed: ") + strerror(errno);
}
fds [1]用于子级,fds [0]用于父级。
现在,我创建一个文件指针-
sockt = fdopen(fds[0], "r+");
I have this if statement : if (write_string(soc...