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

Check Frame if it is a Received or a Sent frame #23

Open
johnfoldager opened this issue Dec 5, 2016 · 7 comments
Open

Check Frame if it is a Received or a Sent frame #23

johnfoldager opened this issue Dec 5, 2016 · 7 comments

Comments

@johnfoldager
Copy link

I'd like to be able to check if a frame is a received frame or a frame that is sent. I can check on the frame.getCommand() for all kinds of frame types and based on that I can make some logic that tells whether it is a received frame or a sent frame based on whether I do client logic or server logic. However, I can't find a good way around checking if a PING frame is a received one or a sent one.

@cescoffier
Copy link
Member

That's an interesting use case. Do you need to handle PING frames, as they are used for heartbeat, they are not (should not be) related to your application logic.

@johnfoldager
Copy link
Author

I'm working on a sniffer component that needs to be able to check if the client or the server is fx. not sending PING frames every x second. Just one use case.

@cescoffier
Copy link
Member

@johnfoldager
Copy link
Author

Maybe I could do that, but wouldn't it be nice if it was possible from the Frame object to determine whether it is an outgoing or incoming frame?

@cescoffier
Copy link
Member

We can add this feature, fancy a PR ?

@johnfoldager
Copy link
Author

Is PR a Pull Request? I'm not into the Vert.x source yet or the Git and GitHub terminologies and probably can't do this just yet, but I'd like to find out how to contribute to the project soon.

@cescoffier
Copy link
Member

Yes, a PR is a pull request. Here is seems straightforward:

  1. Add a field to the Frame class (probably boolean such as received)
  2. Set this field when a frame is received

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

No branches or pull requests

2 participants