Thema: Delphi Spielwiese - SocketTest

Einzelnen Beitrag anzeigen

Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#33

AW: Spielwiese - SocketTest

  Alt 23. Dez 2016, 15:02
Das ist bei den (dummen ) non-blocking Sockets leider auch wieder mal komplizierter:
Zitat von MSDN recv():
If no incoming data is available at the socket, the recv call blocks and waits for data to arrive according to the blocking rules defined for WSARecv with the MSG_PARTIAL flag not set unless the socket is nonblocking. In this case, a value of SOCKET_ERROR is returned with the error code set to WSAEWOULDBLOCK. The select, WSAAsyncSelect, or WSAEventSelect functions can be used to determine when more data arrives.
Es ist schon so, wie ich es geschrieben habe. Die Dokumentation liest sich nur leider manchmal etwas verwirrend.

Ich versuche es noch mal in Tabellenform:
Code:
                               | Verbindung besteht | Verbindung geschlossen
Lesbare Bytes vorhanden        | > 0                | --
Keine lesbaren Bytes vorhanden | -1                 | 0
Fehler                         | -1                 | -1

(Wie zur Hölle verwendet man den [TABLE]-BBCode? )
  Mit Zitat antworten Zitat