Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageSent callback does not trigger when UseSocketFilter = true #7

Open
highlyunavailable opened this issue Jul 28, 2019 · 1 comment

Comments

@highlyunavailable
Copy link

If I set the UseSocketFilter property of an FFXIVNetworkMonitor to true, the callback for MessageSent never triggers. I'm using raw sockets, not winpcap.

I've ensured that the app is allowed through the firewall and there are no errors in the trace log. At a deeper level, it looks like ProcessSentMessage is never called because no packets are ever returned for the sent side of the connection. Is this a limitation of UseSocketFilter or is there further configuration I need to do?

@ravahn
Copy link
Owner

ravahn commented Nov 27, 2021

I've finally tracked this down. The reason for this behavior is because the code is using winsock Connect() function to filter on the remote IP when UseSocketFilter is set to true. However, according to documentation https://docs.microsoft.com/en-us/windows/win32/winsock/tcp-ip-raw-sockets-2?redirectedfrom=MSDN:

If a foreign address is defined for the socket, it should correspond to the source address as specified in the IP header of the received datagram

For raw sockets, the received packets will have the expected remote ip as the source address. Unfortunately, packets originating from the game will have source address = local ip, and so this is the reason these packets are not available when this feature is turned on.

I will need to consider a larger change to Machina to resolve this - probably creating multiple raw sockets, one for each direction, when this flag is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants