Revision: 08e54137c429
Author: Alexandre Mendonça <ammendonca>
Date: Fri Aug 1 00:31:10 2014 UTC
Log: Guarantee complete write for non blocking NIO SocketChannel.
Update Issue 41
Status: Fixed
Fixed according to suggestion.
http://code.google.com/p/jdiameter/source/detail?r=08e54137c429
Added:
/core/mux/sar-jboss-5/src/main/resources/META-INF/jboss-deployment-structure.xml
Modified:
/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java
=======================================
--- /dev/null
+++
/core/mux/sar-jboss-5/src/main/resources/META-INF/jboss-deployment-structure.xml
Fri Aug 1 00:31:10 2014 UTC
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-deployment-structure>
+ <deployment>
+ <resources>
+ <resource-root
path="lib/mobicents-diameter-mux-jar-1.4.0.FINAL.jar">
+ </resource-root>
+ </resources>
+ </deployment>
+</jboss-deployment-structure>
=======================================
---
/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java
Thu Jul 10 02:21:30 2014 UTC
+++
/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java
Fri Aug 1 00:31:10 2014 UTC
@@ -292,11 +292,13 @@
if (logger.isDebugEnabled()) {
logger.debug("About to send a byte buffer of size [{}] over the TCP
nio socket [{}]", bytes.array().length, socketDescription);
}
- int rc;
+ int rc = 0;
// PCB - removed locking
// lock.lock();
try {
- rc = socketChannel.write(bytes);
+ while (rc < bytes.array().length) {
+ rc += socketChannel.write(bytes);
+ }
}
catch (Exception e) {
logger.error("Unable to send message", e);
--
---
You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.