MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / getSocketType

Function getSocketType

lib/host/wasi/inode-win.cpp:174–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174inline __wasi_filetype_t getSocketType(SOCKET_ Socket) noexcept {
175 int SocketType = 0;
176 int Size = sizeof(SocketType);
177 if (likely(getsockopt(Socket, SOL_SOCKET, SO_TYPE,
178 reinterpret_cast<char *>(&SocketType), &Size) == 0)) {
179 switch (SocketType) {
180 case SOCK_STREAM:
181 return __WASI_FILETYPE_SOCKET_STREAM;
182 case SOCK_DGRAM:
183 return __WASI_FILETYPE_SOCKET_DGRAM;
184 }
185 }
186 return __WASI_FILETYPE_UNKNOWN;
187}
188
189inline WasiExpect<DWORD_> getAttribute(HANDLE_ Handle) noexcept {
190#if NTDDI_VERSION >= NTDDI_VISTA

Callers 1

filetypeMethod · 0.85

Calls 1

likelyFunction · 0.50

Tested by

no test coverage detected