fpsockets

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

fpsockets

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.

--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fpsockets

Victor Campillo
On 30/10/17 13:37, José Mejuto wrote:

> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fpsockets

José Mejuto
El 30/10/2017 a las 15:40, Victor Campillo escribió:

> 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.


--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fpsockets

Victor Campillo
On 31/10/17 10:26, José Mejuto wrote:
> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal