Giter VIP home page Giter VIP logo

encon-java's People

Contributors

xxlabaza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

encon-java's Issues

GPG key error

It seems there is an error with a downloading and installing the Encon's jar from Maven Central without GPG key.

Encode/Decode error for nonode@nohost PIDs

It seems encon doesn't survive while decoding->encoding+serializing PIDs in format of #PID<0.639.0>

Exception:

io.appulse.encon.terms.exception.IllegalErlangTermTypeException: Class io.appulse.encon.ter
ms.type.ErlangAtom doesn't fit to term type ATOM

Steps to reproduce:

  1. In Elixir: File.write!("pid.term", :erlang.term_to_binary(self))
  2. On Java side:
    Read the first byte of "pid.term" file (it's 131)
  3. Read the rest into ByteBuf
  4. Decode bytebuf into proper java class with ErlangTerm/newInstance
  5. Encode/serialize it to another ByteBuf. Get the error above.

I suspect that the atom for node name of such PID constructs with incorrect value field:

#object[io.appulse.encon.terms.type.ErlangAtom 0x1c433450 "ErlangAtom(value=nu
ll, bytes=[110, 111, 110, 111, 100, 101, 64, 110, 111, 104, 111, 115, 116], ch
arset=ISO-8859-1)"]

ErlangPid.cached weak hash funciton

Starting from some point, the encon library decodes PID's incorrectly and returns previously cached PID instead of creating the new one:

"ENCON GOT: [\"#PID<0.671.0>\"]
while
JInterface got: #Pid<[email protected]>

896 is the right id of a PID that was sent from Elixir side.

Could you also ditch the caching function while creating atom return (T) ErlangAtom.cached(type, buffer) in ErlangTerm newInstance function? Just in case.

ErlangPid lombok-generated hash code is inconsistent wrt PID types

Since there is an @EqualsAndHashCode(callSuper = true) annotation on ErlangPid, type field is considered for hashcode & equals, which means otherwise identical but different in PID/NEW_PID ErlangPids would be considered different, which means we don't get replies.
I bumped into this by simply launching elixir (iex --sname foo) and then doing ping from JVM.
After building locally with hashcode() defined as

@Override
  public int hashCode() {
    return Objects.hash(descriptor, id, serial, creation);
  }

message exchange works. I can submit a PR if this is the right solution or I would be happy to hear your thoughts on this in general.

ErlangString proposal

When value.length() > 65535 || !is8bitString() consider to encode such string in ErlangBinary (BINARY_EXT) rather than in list. It's way more easier to handle binaries on a erlang/elixir side. Especially when such string is somewhere inside a nested data structure.
Thanks!

Weak hashing function for ErlangInteger::cached

The function ErlangInteger::cached is used inside string serialization mechanism. But it's internal hashing mechanism is too weak. For instance hash for ErlangInteger::cached(1273) and ErlangInteger::cached(117) in both cases is equal to 923638.

As a result the resulting string which has both symbols with code 1273 and 117 when in LIST mode becomes corrupted.

Please fix it or rather change string serialization to use non-cached constructor of ErlangInteger

:up: netty version

Hey.
Is it possible to bump up netty version to the latest one (4.1.34.Final as for now)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.