But in this case, the reader of the stream socket gets 200 bytes.
但在本例中,流套接字的读者得到的是200字节。
As you can see, the output stream is parameterized: you can send some logs to a file and others to a network socket.
可以看出,输出流是参数化的:您可以把一些日志记录放在文件中,其他的送往网络套接字。
More importantly though, it automatically applies them as necessary beneath a simple stream socket API.
不过更重要的是,在简单流套接字api背后,它会在必要时自动使用它们。
The output stream of the socket becomes the input stream to the server application and vice-versa.
套接字的输出流将成为服务器应用程序的输入流,反之亦然。
The architectural diagram below in Figure 3 shows how the client and server applications have access to a socket that has an input and an output stream.
图3中的架构图显示了客户端和服务器应用程序如何访问具有输入和输出流的套接字。
Returns an input stream for this socket.
返回此套接字的输入流。
Returns an output stream for this socket.
返回此套接字的输出流。
This can be contrasted with a stream socket, where if the sender wrote a 100 byte message, the receiver could read it in two chunks of 50 bytes or 100 chunks of one byte.
对比字符流,当发送者发送100字节时,接收者可以选择接受分两次,每次50字节进行接受,还是一次性接受100字节。
Creates either a stream or a datagram socket.
创建数据流或数据报套接字。
The article recommends a method to receive file with static variables in Internet SOCKET class. The FTP is realized through sending a stream file to another remote computer and recovering it.
介绍了应用在SOCKET下定义静态变量实现接受文件的方法,把指定远程计算机的发送的流文件接收到主机上,还原文件以实现FTP协议。
These two programs can be compiled and run in exactly the same way as the server and client using a stream socket.
编译这两个程序,像上面文本流的例子一样运行他们。
SOCK_SEQPACKET socket is just like a SOCK_STREAM socket except that we get a message-based service instead of a byte-stream service.
套接口sock_seqpacket类似于SOCK_STREAM套接口,不同的是我们得到的是一个基于消息的服务,而不是一个字节流服务。
SOCK_SEQPACKET socket is just like a SOCK_STREAM socket except that we get a message-based service instead of a byte-stream service.
套接口sock_seqpacket类似于SOCK_STREAM套接口,不同的是我们得到的是一个基于消息的服务,而不是一个字节流服务。
应用推荐