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

Method sockConnect

lib/host/wasi/inode-linux.cpp:1030–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1028}
1029
1030WasiExpect<void> INode::sockConnect(__wasi_address_family_t AddressFamily,
1031 Span<const uint8_t> Address,
1032 uint16_t Port) noexcept {
1033 auto AddressBuffer = sockAddressAssignHelper(AddressFamily, Address, Port);
1034
1035 auto ClientAddr = std::visit(VarAddrBuf(), AddressBuffer);
1036 int Size = std::visit(VarAddrSize(), AddressBuffer);
1037
1038 if (auto Res = ::connect(Fd, ClientAddr, Size); unlikely(Res < 0)) {
1039 return WasiUnexpect(fromErrNo(errno));
1040 }
1041
1042 return {};
1043}
1044
1045WasiExpect<void> INode::sockRecv(Span<Span<uint8_t>> RiData,
1046 __wasi_riflags_t RiFlags, __wasi_size_t &NRead,

Callers

nothing calls this directly

Calls 6

unlikelyFunction · 0.85
WasiUnexpectFunction · 0.85
sockAddressAssignHelperFunction · 0.70
VarAddrBufClass · 0.70
VarAddrSizeClass · 0.70
fromErrNoFunction · 0.70

Tested by

no test coverage detected