正在显示
1 个修改的文件
包含
30 行增加
和
0 行删除
src/server/spserver/spioutils.hpp
0 → 100644
1 | +/* | ||
2 | + * Copyright 2007 Stephen Liu | ||
3 | + * For license terms, see the file COPYING along with this library. | ||
4 | + */ | ||
5 | + | ||
6 | +#ifndef __spioutils_hpp__ | ||
7 | +#define __spioutils_hpp__ | ||
8 | + | ||
9 | +#include "spporting.hpp" | ||
10 | + | ||
11 | +class SP_IOUtils { | ||
12 | +public: | ||
13 | + static void inetNtoa( in_addr * addr, char * ip, int size ); | ||
14 | + | ||
15 | + static int setNonblock( int fd ); | ||
16 | + | ||
17 | + static int setBlock( int fd ); | ||
18 | + | ||
19 | + static int tcpListen( const char * ip, int port, int * fd, int blocking = 1 ); | ||
20 | + | ||
21 | + static int initDaemon( const char * workdir = 0 ); | ||
22 | + | ||
23 | + static int tcpListen( const char * path, int * fd, int blocking = 1, int mode = 0666 ); | ||
24 | + | ||
25 | +private: | ||
26 | + SP_IOUtils(); | ||
27 | +}; | ||
28 | + | ||
29 | +#endif | ||
30 | + |
请
注册
或
登录
后发表评论