MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / load

Method load

kernel/cellos/src/sys_net.cpp:289–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289std::function<void(void *)> lv2_socket::load(utils::serial &ar) {
290 const lv2_socket_type type{ar};
291
292 shared_ptr<lv2_socket> sock_lv2;
293
294 switch (type) {
295 case SYS_NET_SOCK_STREAM:
296 case SYS_NET_SOCK_DGRAM: {
297 auto lv2_native = make_shared<lv2_socket_native>(ar, type);
298 ensure(lv2_native->create_socket() >= 0);
299 sock_lv2 = std::move(lv2_native);
300 break;
301 }
302 case SYS_NET_SOCK_RAW:
303 sock_lv2 = make_shared<lv2_socket_raw>(ar, type);
304 break;
305 case SYS_NET_SOCK_DGRAM_P2P:
306 sock_lv2 = make_shared<lv2_socket_p2p>(ar, type);
307 break;
308 case SYS_NET_SOCK_STREAM_P2P:
309 sock_lv2 = make_shared<lv2_socket_p2ps>(ar, type);
310 break;
311 }
312
313 if (std::memcmp(&sock_lv2->last_bound_addr, std::array<u8, 16>{}.data(),
314 16)) {
315 // NOTE: It is allowed fail
316 sock_lv2->bind(sock_lv2->last_bound_addr);
317 }
318
319 return [ptr = sock_lv2](void *storage) {
320 *static_cast<atomic_ptr<lv2_socket> *>(storage) = ptr;
321 };
322 ;
323}
324
325void lv2_socket::save(utils::serial &ar, bool save_only_this_class) {
326 USING_SERIALIZATION_VERSION(lv2_net);

Callers 15

umtx_waitMethod · 0.45
do_lock_normalFunction · 0.45
do_unlock_normalFunction · 0.45
umtx_cv_waitMethod · 0.45
umtx_rw_rdlockMethod · 0.45
umtx_rw_wrlockMethod · 0.45
umtx_rw_unlockMethod · 0.45
umtx_wake_umutexMethod · 0.45
umtx_wake2_umutexMethod · 0.45
umtx_wake3_umutexMethod · 0.45
waitMethod · 0.45
tryWaitMethod · 0.45

Calls 4

create_socketMethod · 0.80
ensureFunction · 0.50
dataMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected