K
K
krka922020-06-25 14:37:12
Delphi
krka92, 2020-06-25 14:37:12

Why does the send (winsock2) method return SOCKET_ERROR and the error code is 0?

res := Send(FSocketNative, FBufferPartOut.Data[0], FBufferPartOut.Header.Size, 0);

if res = -1 then begin
      WSAError := WSAGetLastError;
      res := GetLastError;
end;


After writing to the socket res = -1. And the error code = 0. Both WSAGetLastError and GetLastError return 0.
Who can tell why this occurs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hemul GM, 2020-06-25
@HemulGM

So go through the debugger until you get the error yourself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question