Feat: Epoll P2P Implementation#4211
Conversation
|
|
|
Windows build fails with: |
|
Seems to break Skullgirls. Just crashes silently after it starts it's P2P stuff. |
Ran on Windows and get the silent crash pretty much every launch sometimes immediately sometimes after a minute. See attached log for same crash on main branch with old (stubbed) epoll P2P implementation. Both crashes in and not in my branch seem to be a failed assert in libusb/core.c:1278 |
|
Seemed to be crashing quicker than usual for me on this PR, which is why I pointed it out. |
|
Thank you for your contribution @Gursukh. While it seems to work with LBP3, the core principle of P2P sockets is different on the real hardware, and it won't work for multiplayer communication. The key differences are:
There may be more differences, but I haven't looked into networking for some time now. RPCS3 contains a working implementation of P2P and it seems like it's almost the same as with PS4, so you can take a look at https://github.com/RPCS3/rpcs3/tree/master/rpcs3/Emu/Cell/lv2/sys_net If you have any questions feel free to ask here |
|
Hey @mikusp, thanks for the feedback. I'll work on revising the approach. Can you recommend a game that would work well to test P2P connections? |
|
the last of us remastered has p2p for its factions mode, im aware of some weird graphical errors in the game but you can get in game on nightly |
core/net: back P2P sockets with real host sockets and unify epoll handling
Move P2P socket behavior onto actual UDP/TCP file descriptors instead of stubbed flow.
P2P sockets now own a real native socket, expose it through Native(), track socket type/non-blocking state/vport, and close cleanly on teardown.
Rewrite P2P operations to delegate to the OS:
bind/connect with address conversion and vport tracking
send/recv paths via sendto/sendmsg and recvfrom/recvmsg
socket option get/set through converted levels, including PS4-specific handling
accept returns a wrapped real accepted fd
getsockname/getpeername now return real endpoint data
Also clean up shared networking internals by promoting common helper conversions, removing duplicate Unix-side helpers/macros, and dropping the old epoll eventfd drain path.
With Native() now returning real fds for P2P sockets, epoll handling is unified across socket types.
Fyi, didnt test on windows only linux. This was targeted for LBP