1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.server.mux;
20
21 import java.io.IOException;
22 import java.nio.ByteBuffer;
23
24 import org.eclipse.jetty.http.HttpGenerator.ResponseInfo;
25 import org.eclipse.jetty.io.EofException;
26 import org.eclipse.jetty.server.HttpTransport;
27 import org.eclipse.jetty.util.BlockingCallback;
28 import org.eclipse.jetty.util.Callback;
29 import org.eclipse.jetty.util.log.Log;
30 import org.eclipse.jetty.util.log.Logger;
31 import org.eclipse.jetty.websocket.common.extensions.mux.MuxChannel;
32 import org.eclipse.jetty.websocket.common.extensions.mux.Muxer;
33
34
35
36
37 public class HttpTransportOverMux implements HttpTransport
38 {
39 private static final Logger LOG = Log.getLogger(HttpTransportOverMux.class);
40 private final BlockingCallback streamBlocker = new BlockingCallback();
41
42 public HttpTransportOverMux(Muxer muxer, MuxChannel channel)
43 {
44
45 }
46
47 @Override
48 public void completed()
49 {
50 LOG.debug("completed");
51 }
52
53
54
55
56 @Override
57 public void send(ResponseInfo info, ByteBuffer responseBodyContent, boolean lastContent) throws IOException
58 {
59 send(info,responseBodyContent,lastContent,streamBlocker);
60 try
61 {
62 streamBlocker.block();
63 }
64 catch (IOException e)
65 {
66 throw e;
67 }
68 catch (Exception e)
69 {
70 throw new EofException(e);
71 }
72 }
73
74 @Override
75 public void send(ResponseInfo info, ByteBuffer responseBodyContent, boolean lastContent, Callback callback)
76 {
77 if (lastContent == false)
78 {
79
80 }
81
82 if (info.getContentLength() > 0)
83 {
84
85 }
86
87
88
89 }
90 }