acl/lib_acl/include/net/acl_sane_socket.h

42 lines
1019 B
C
Raw Normal View History

2014-09-06 23:08:25 +08:00
#ifndef ACL_SANE_SOCKET_INCLUDE_H
#define ACL_SANE_SOCKET_INCLUDE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
/**
* ȡ<EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӶԷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ, <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʽΪ: IP:PORT
* @param sockfd {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD>
* @param buf {char*} <EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* @param bsize {size_t} buf <EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>С
* @return {int} 0: ok; -1: error
*/
ACL_API int acl_getpeername(ACL_SOCKET sockfd, char *buf, size_t bsize);
/**
* ȡ<EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ, <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʽΪ: IP:PORT
* @param sockfd {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD>
* @param buf {char*} <EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* @param bsize {size_t} buf <EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>С
* @return {int} 0: ok; -1: error
*/
ACL_API int acl_getsockname(ACL_SOCKET sockfd, char *buf, size_t bsize);
/**
* ȡ<EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param sockfd {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD>
* @return {int} -1: <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD>; >= 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD> AF_INET <EFBFBD><EFBFBD> AF_UNIX(<EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIX ƽ̨)
*/
ACL_API int acl_getsocktype(ACL_SOCKET sockfd);
#ifdef __cplusplus
}
#endif
#endif