What does dot before method name mean?

Stephen Miller harakim at gmail.com
Sat May 8 02:29:18 UTC 2021


On Saturday, 8 May 2021 at 01:48:22 UTC, Adam D. Ruppe wrote:
> On Saturday, 8 May 2021 at 01:45:49 UTC, Stephen Miller wrote:
>> I am writing a tcp proxy server and I noticed that when a 
>> socket is in non-blocking mode, it returns -1 if it doesn't 
>> receive data, as opposed to 0.
>
> It sets the `wouldHaveBlocked` flag in that case returning -1. 
> 0 always means connection closed.
>
>> My questions are: What does the dot in front of recv mean? 
>> Where is that code?
>
> Leading dot means to look it up from top level instead of the 
> local/class member. So then it uses the system function - recv 
> from C - instead of the local ones.

Thanks for the explanation. Is there an easy way to know what the 
system functions are? Is it defined by the standard library or 
does it just include all the system libraries (or some subset) 
for the operating system you are on?

Also, thanks for the wouldHaveBlocked flag information. That 
makes everything about the socket method return types make sense.


More information about the Digitalmars-d-learn mailing list