Ben*_*n S 6 c c++ sockets solaris
我试图使用以下方法关闭Nagle的BSD套接字算法:
setsockopt(newSock, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof flag);
Run Code Online (Sandbox Code Playgroud)
但编译器声称TCP_NODELAY
以前没有见过:
error: `TCP_NODELAY' undeclared (first use this function)
Run Code Online (Sandbox Code Playgroud)
这是该文件包含的完整列表:
#include <arpa/inet.h>
#include <fcntl.h>
#include <iostream>
#include <netdb.h>
#include <string>
#include <sys/socket.h>
#include <sys/types.h>
using namespace std;
Run Code Online (Sandbox Code Playgroud)
我也有-lnsl
和-lsocket
链接器选项,但它不会编译.我错过了什么吗?
所有这些都在Solaris 8机器上.
归档时间: |
|
查看次数: |
12782 次 |
最近记录: |