public
Fork of eventmachine/eventmachine
Description: EventMachine - Sync from svn repo at rubyeventmachine.com
Homepage: http://www.rubyeventmachine.com
Clone URL: git://github.com/tmm1/eventmachine.git
Fix send_data issue with java reactor (#50)
tmm1 (author)
Tue Aug 26 22:19:05 -0700 2008
commit  0305f2f3d8a838d5c0712adec0a0a46512784029
tree    2aba586c6a981c8351c23a2ef77e81ddac57c851
parent  81be32a56e8c94ab42d2d8e68d5786d3d55e85c1
...
309
310
311
312
313
 
 
314
315
316
...
309
310
311
 
 
312
313
314
315
316
0
@@ -309,8 +309,8 @@ public class EmReactor {
0
   public void sendData (String sig, ByteBuffer bb) throws IOException {
0
     (Connections.get(sig)).scheduleOutboundData( bb );
0
   }
0
-  public void sendData (String sig, String data, int length) throws IOException {
0
-    sendData (sig, ByteBuffer.wrap(data.getBytes()));
0
+  public void sendData (String sig, byte[] data) throws IOException {
0
+    sendData (sig, ByteBuffer.wrap(data));
0
     //(Connections.get(sig)).scheduleOutboundData( ByteBuffer.wrap(data.getBytes()));
0
   }
0
   public void setCommInactivityTimeout (String sig, long mills) {
...
75
76
77
78
 
79
80
81
...
75
76
77
 
78
79
80
81
0
@@ -75,7 +75,7 @@ module EventMachine
0
     raise "unsupported on this platform"
0
   end
0
   def self.send_data sig, data, length
0
-    @em.sendData sig, data, length
0
+    @em.sendData sig, data.to_java_bytes
0
   end
0
   def self.send_datagram sig, data, length, address, port
0
     @em.sendDatagram sig, data, length, address, port

Comments