Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java10
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java2
2 files changed, 8 insertions, 4 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
index 3dad3741a..98997833c 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
@@ -58,6 +58,10 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
public class EclipseCollabSharedObject extends GenericSharedObject {
+ /**
+ *
+ */
+ private static final int MAX_MESSAGE_SIZE = 8096;
private static final String HANDLE_SHOW_VIEW_MSG = "handleShowView";
private static final String HANDLE_SHOW_VIEW_WITH_ID_MSG = "handleShowViewWithID";
private static final String HANDLE_LAUNCH_EDITOR_FOR_FILE_MSG = "handleLaunchEditorForFile";
@@ -528,13 +532,13 @@ public class EclipseCollabSharedObject extends GenericSharedObject {
try {
forwardMsgTo(toID, SharedObjectMsg.createMsg(null, HANDLE_SHOW_IMAGE_START_MSG, localContainerID, localUser.getNickname(), new ImageWrapper(imageData)));
final byte[] compressedData = compress(imageData.data);
- final ByteArrayOutputStream bos = new ByteArrayOutputStream(8096);
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream(MAX_MESSAGE_SIZE);
int startPos = 0;
while (startPos <= compressedData.length) {
bos.reset();
- final int length = Math.min(compressedData.length - startPos, 8096);
+ final int length = Math.min(compressedData.length - startPos, MAX_MESSAGE_SIZE);
bos.write(compressedData, startPos, length);
- startPos += 8096;
+ startPos += MAX_MESSAGE_SIZE;
bos.flush();
final Boolean done = new Boolean((compressedData.length - startPos) < 0);
forwardMsgTo(toID, SharedObjectMsg.createMsg(null, HANDLE_SHOW_IMAGE_DATA_MSG, localContainerID, bos.toByteArray(), done));
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
index 8beea8fcd..c9a27844b 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
@@ -541,7 +541,7 @@ public class ChatComposite extends Composite {
private void sendImage(ID targetID) {
final Job job = new ScreenCaptureJob(getDisplay(), targetID);
- job.schedule();
+ job.schedule(5000);
}
private void fillTreeContextMenuUser(IMenuManager man, final User user) {

Back to the top