Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-10

fpsockets

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

José Mejuto

Hello,

Do exists any way using the fpsockets family to know if a "fprecv" will block ? In other words do exists a call that return the amount of bytes that are ready to be read/received ?

In the case the answer is no, does fpc has another family of socket functions ? I know synapse, lNet, ... but I wish to use only fpc packages.

Reply by email

Victor Campillo
to José Mejuto
José Mejuto wrote 10 lines
Hello, Do exists any way using the fpsockets family to know if a "fprecv" will block ? In other words do exists a call that return the amount of bytes that are ready to be read/received ? In the case the answer is no, does fpc has another family of socket functions ? I know synapse, lNet, ... but I wish to use only fpc packages.

Hello,

You have the function "FpIOCtl" with the option FIONREAD, I use it to read the amount of data of the reception buffer before call "fprecv" but if I remember correctly this only work when you configure the socket as asynchronous.

Best Regards.

Victor Campillo

Reply by email

José Mejuto
to Victor Campillo
Victor Campillo wrote
You have the function "FpIOCtl" with the option FIONREAD, I use it to read the amount of data of the reception buffer before call "fprecv" but if I remember correctly this only work when you configure the socket as asynchronous.

Hello,

fpioctl seems to not be implemented in Windows, but anyway your help give me a clue about a possible solution to my problem. Thank you.

Reply by email

Victor Campillo
to José Mejuto
José Mejuto wrote 8 lines
El 30/10/2017 a las 15:40, Victor Campillo escribió: Hello, fpioctl seems to not be implemented in Windows, but anyway your help give me a clue about a possible solution to my problem. Thank you.

Hello,

In windows you have the function "ioctlsocket" in the unit WinSock2 which do the same as "fpioctl", anyway I am glad that you find a path to the solution.

Best Regards.

Victor Campillo

Reply by email