So lots of items here. Will try to break them out into groups. 1. How to send streams
Really only two ways to do it. First is to write the actual data to a byte array (or some other data holder) and send the whole thing over the wire. Biggest problem with this is that if large file, will probably get out of memory errors. Second is to remote read on demand of the bytes, so can be writen directly to disk (or whatever) on the server side to avoid running out of memory since don't have to keep all the data in memory. Remoting allows for either, but the Client.invoke(InputStream inputStream, Object param) is for the second option. 2. Client to server and server to client sending of streams Currently, remoting only allows a client to send a stream (actually a remote proxy to a stream) to the server, which can then read the stream on demand. However, there is no way for the client to read a stream that exists on the server. One of the main reasons for this need to figure out how to define the API for this. I would like this to be a different method since want it to be typed on both sides (meaning both client and server explicitly know they are dealing with a stream now instead of regular object instance being serialized). Also, how to define exactly which file/stream the client wants from the server? The other (probably bigger reason) for not having this is no one has asked for it. If you have a use case, will work on adding it (if you can devise a simple test case illustrating what you are looking for, what would be great). 3. Physical connection for sending streams As mentioned, the client will create a StreamServer which acts as a remoting server to deliver data from the stream being read to the server instance requesting it (via the stream proxy on the server side). In almost all cases, this is going to require another physical connection to be created from the server instance back to the client instance as the server instance (handler to be more specific) will ask for the bytes from the stream living on the client whenever it wants (so has to be on demand, which requires that connection). This just wouldn't be possible to do using a polling mechanism. So the only way would be possible to do this using the same physical connection would be to use the multiplex transport (which by nature, can use the same physical connection for two-way communication). 4. Concurrent use I did just make a change for JBREM-519, so that for each StreamServer created, it will use the PortUtil.findFreePort() so that for each time a stream is sent from the client, a new remoting server will be created to receive the stream read requests from the server. This will allows for multiple streams to be read at the same time by the server. I know this is not the greatest option due to having no control over config for ports being used (more in this below). 5. Configuration The current remoting streaming implementation is obviously a very simple one and till now, no one had expressed any interest in using it, so have not devoted a lot of energy to improviing it (obvious by limited config). As you mentioned, can only control basic config info (transport, port, etc.) via setting system properties. I see two immediate ways to make this more configurable (but am open to any other suggestions). First, can just allow user to send the Connector to use for the StreamServer, as Mazz suggested. This provides complete control over the remoting server used. However, this is probably a little more work than most people would want to do. So the second option would be to try and do what we do for push callbacks where try to use the same config in use already. So the StreamServer would try to use the same config as already in use by the Client, to include any ssl config if it exists (same for server) and will flip the useClientMode on each side. Will still have the problem of how to configure the port to be used though... not sure how to best do this. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3953125#3953125 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3953125 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
