Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed:

  * updated function signature for sendDatagram to accept a byte[] for data
    instead of a String.  this matches the behavior of the sendData() function
    for TCP and prevents mangling of your packets due to UTF-safety problems.
  * updated send_datagram in jeventmachine.rb to call .to_java_bytes on data
    for compatibility with above.
  • Loading branch information...
commit 8986927ca796141e2ff47fbce3f8cc81448c0988 1 parent 89c88eb
cturner authored
View
4 java/src/com/rubyeventmachine/EmReactor.java
@@ -442,8 +442,8 @@ public void setCommInactivityTimeout (long sig, long mills) {
Connections.get(sig).setCommInactivityTimeout (mills);
}
- public void sendDatagram (long sig, String data, int length, String recipAddress, int recipPort) {
- sendDatagram (sig, ByteBuffer.wrap(data.getBytes()), recipAddress, recipPort);
+ public void sendDatagram (long sig, byte[] data, int length, String recipAddress, int recipPort) {
+ sendDatagram (sig, ByteBuffer.wrap(data), recipAddress, recipPort);
}
public void sendDatagram (long sig, ByteBuffer bb, String recipAddress, int recipPort) {
View
2  lib/jeventmachine.rb
@@ -118,7 +118,7 @@ def self.send_data sig, data, length
@em.sendData sig, data.to_java_bytes
end
def self.send_datagram sig, data, length, address, port
- @em.sendDatagram sig, data, length, address, port
+ @em.sendDatagram sig, data.to_java_bytes, length, address, port
end
def self.connect_server server, port
bind_connect_server nil, nil, server, port
Please sign in to comment.
Something went wrong with that request. Please try again.