⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stel_socket.h

📁 一个有关挂载U盘
💻 H
字号:
#ifndef STEL_SOCKET_H_
#define STEL_SOCKET_H_

int Socket( int family, int type, int protocol );

int Inet_pton (int family, const char *src, void *dst);

int Connect( int fd, const struct sockaddr *addr, socklen_t len );

ssize_t Recv( int fd, void *ptr, size_t nbytes );

ssize_t Send( int fd, const void *ptr, size_t nbytes );

/*
 *function_name: Stel_Connect
 *参数说明, port: 连接端口; ip: 连接IP; timeout: 超时时间
 *return: 大于0--成功;其它:失败;
 */
int Stel_Connect( int port, char *ip, int timeout );

/*
 *function_name: Stel_Recv
 *参数说明,fd: 整数型socket; ptr: 待发送的内容; nbytes: 要发送的内容大小; timeout: 超时时间
 *return: 0--成功;其它:失败;
 */
int Stel_Recv( int fd, void *ptr, size_t nbytes, int timeout );

/*
 *function_name: Stel_Send
 *参数说明,fd: 整数型socket; ptr: 待发送的内容; nbytes: 要发送的内容大小; timeout: 超时时间
 *return: 0--成功;其它:失败;
 */
int Stel_Send( int fd, const void *ptr, size_t nbytes, int timeout );

/*
 *function_name: Stel_Recv_NoBlock
 *参数说明,fd: 整数型socket; ptr: 待发送的内容; nbytes: 要发送的内容大小; timeout: 超时时间
 *return: 0--成功;其它:失败;
 */
int Stel_Recv_NoBlock( int fd, void *ptr, size_t nbytes, int timeout );

#endif /*STEL_SOCKET_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -