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

A bug in engineio.parser.ParserV4 #38

Closed
EasonLyo opened this issue Jul 1, 2021 · 5 comments
Closed

A bug in engineio.parser.ParserV4 #38

EasonLyo opened this issue Jul 1, 2021 · 5 comments

Comments

@EasonLyo
Copy link

EasonLyo commented Jul 1, 2021

`public void encodePayload(List<Packet> packets, boolean supportsBinary, EncodeCallback callback) { final String[] encodedPackets = new String[packets.size()]; for (int i = 0; i < encodedPackets.length; i++) { final Packet packet = packets.get(i);

        final int packetIdx = i;
        encodePacket(packet, false, data -> encodedPackets[packetIdx] = (String) data);
    }

    callback.call(String.join(SEPARATOR, encodedPackets));
}`

it should be :
`public void encodePayload(List<Packet> packets, boolean supportsBinary, EncodeCallback callback) { final String[] encodedPackets = new String[packets.size()]; for (int i = 0; i < encodedPackets.length; i++) { final Packet packet = packets.get(i);

        final int packetIdx = i;
        encodePacket(packet, supportsBinary, data -> encodedPackets[packetIdx] = (String) data);
    }

    callback.call(String.join(SEPARATOR, encodedPackets));
}`

i fould the code during I runing the unit test in your project.

@trinopoty
Copy link
Collaborator

trinopoty commented Jul 1, 2021

Version 4 of the engine.io protocol does not support binary encoding over polling transport.
Since encodePayload is only called by the polling transport, this piece of code is correct.

@EasonLyo
Copy link
Author

EasonLyo commented Jul 2, 2021

thx for replay,i will close issue soon.

in fact,I have a idea to coding a socket.io serve by use vert.x and i have read socket.io-java-client ,engine-io-server,socketio-nodejs,can u give me some advice or idea?

In your perspective,Is vert.x suitable?

@trinopoty
Copy link
Collaborator

I don't have any experience with vert,x. You'll have to make any decisions on your own but I'd say go for it.
Sharing a single protocol across multiple tech stacks does have it's pros so it's never a bad thing to port socket.io to other stacks.

@EasonLyo
Copy link
Author

EasonLyo commented Jul 4, 2021

thx and I'll give it a try!can u help me get some solution when i got any trouble about engine.io protocol or socket.io?

@trinopoty
Copy link
Collaborator

Sure. if you have any questions about the protocol, you can ask me and I'll try my best to answer.

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