Windows socket read




















Familiarity with Windows networking is required. Windows Sockets 2 can be used on all Windows platforms. Where certain implementations or capabilities of Windows Sockets 2 platform restrictions do exist, they are clearly noted in the documentation. Quality of Service. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta.

New post summary designs on greatest hits now, everywhere else eventually. Privacy policy. A set of flags that influences the behavior of this function. See remarks below. See the Remarks section for details on the possible value for this parameter. If no error occurs, recv returns the number of bytes received and the buffer pointed to by the buf parameter will contain this data received.

If the connection has been gracefully closed, the return value is zero. The recv function is used to read incoming data on connection-oriented sockets, or connectionless sockets. When using a connection-oriented protocol, the sockets must be connected before calling recv. When using a connectionless protocol, the sockets must be bound before calling recv.

The local address of the socket must be known. For server applications, use an explicit bind function or an implicit accept or WSAAccept function. Explicit binding is discouraged for client applications. For connected or connectionless sockets, the recv function restricts the addresses from which received messages are accepted.

The function only returns messages from the remote address specified in the connection. Messages from other addresses are silently discarded. For unreliable protocols for example, UDP the excess data is lost; for reliable protocols, the data is retained by the service provider until it is successfully read by calling recv with a large enough buffer.



0コメント

  • 1000 / 1000