What does dot before method name mean?

Stephen Miller harakim at gmail.com
Sat May 8 01:45:49 UTC 2021


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.
I wanted to track down the documentation or figure out what might 
be going on, so I went to the dlang documentation page for 
std.socket.Socket. The code for receive calls .recv. I don't know 
where that is defined. It calls other methods in the same way (eg 
.recvFrom).

Here is the actual code:
```d
return buf.length
                    ? .recv(sock, buf.ptr, capToInt(buf.length), 
cast(int) flags)
                    : 0;
```

This is the reference.
https://github.com/dlang/phobos/blob/19264401a8873c211b0ee815fef660d6e7eb081d/std/socket.d#L3085


My questions are: What does the dot in front of recv mean? Where 
is that code?


More information about the Digitalmars-d-learn mailing list