用户工具

站点工具


linux:socket编程

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
linux:socket编程 [2026/10/13 22:10] – 外部编辑 127.0.0.1linux:socket编程 [2026/10/13 22:51] (当前版本) – 外部编辑 127.0.0.1
行 15: 行 15:
  
 #### - recv,read #### - recv,read
-<code>+ 
 +```
 Returns the number of bytes actually recieved (which might be less than you requested in the Returns the number of bytes actually recieved (which might be less than you requested in the
 len paramter), or -1 on error (and errno will be set accordingly.) len paramter), or -1 on error (and errno will be set accordingly.)
 If the remote side has closed the connection, recv() will return 0. This is the normal method If the remote side has closed the connection, recv() will return 0. This is the normal method
 for determining if the remote side has closed the connection. for determining if the remote side has closed the connection.
-</code> +``` 
 + 
  
 ### - function ### - function
-<code>+ 
 +```
 1. Socket creation: 1. Socket creation:
 int sockfd = socket(domain, type, protocol) int sockfd = socket(domain, type, protocol)
行 192: 行 195:
  
 Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
 +```
  
- 
-</code> 
  
  
行 203: 行 205:
  
 ### - 服务端代码 ### - 服务端代码
-<code c>+ 
 +```c
  
 #include <stdio.h> #include <stdio.h>
行 281: 行 284:
     return 0;     return 0;
 } }
 +```
  
-</code> 
  
  
  
 ### - 客户端代码 ### - 客户端代码
-<code c>+ 
 +```c
 #include <stdio.h> #include <stdio.h>
 #include <stdlib.h> #include <stdlib.h>
行 335: 行 339:
     return 0;     return 0;
 } }
 +```
  
-</code> 
linux/socket编程.1791900622.txt.gz · 最后更改: 由 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki