[英]Which function should I look into to make a socket in C?
What function should I look into to create a socket for my mini-ftp server in C in the stdlib, except recv
, send
and all system calls that make a socket non-blocking?我应该研究什么 function 为我的 mini-ftp 服务器在 stdlib 中的 C 创建一个套接字,除了recv
, send
和所有使套接字非阻塞的系统调用?
There are plenty of guides for this sort of thing, in particular see Beej's Guide to Network Programming for working with Linux.这类事情有很多指南,特别是有关使用 Linux的 Beej 网络编程指南。 There are similar / equivelant APIs exposed in Windows and other operating systems. Windows 和其他操作系统中公开了类似/等效的 API。
Fundamentally though, if you're using Liunx, you'll be interested in:但从根本上说,如果您使用的是 Liunx,您会对以下内容感兴趣:
socket()
to create the socket socket()
创建套接字connect()
/ bind()
and listen()
to connect or listen connect()
/ bind()
和listen()
连接或监听send()
and recv()
to send and receive send()
和recv()
发送和接收If you're interested in non-blocking I/O, then the " Blocking " section will help.如果您对非阻塞 I/O 感兴趣,那么“阻塞”部分会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.