avalon-apps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Coughlin" <ecough...@gollaborate.com>
Subject Re: socket connection disappears
Date Thu, 14 Nov 2002 19:34:32 GMT
Greg,

Thanks for the suggestion.  My implementation of the ConnectionHandler does
not perform a disconnect or socket close().  I understood you to be saying
that it should not.

Your suggestion did cause me to look into the application listener that i
needed to implement as part of the port to the newer Avalon since it is
being called by the FW to instantiate the ConnectionHandler.  I discovered
that the FW is calling the ReleaseConnectionHandler method implemented by
the application listener.

What I don't understand is why it is doing so when the handler is in the
middle of parsing and emitting xml messages over the socket.  Does anyone
have suggestions on how I need to regulate the AutoPublisher so that it does
not pre-maturely release the connection handler?

I've included my assembly.xml and config.xml files in case there is a
glaring mistake in them.

Thanks Greg and if there are any more suggestions I will appreciate hearing
them.

Ed

Assembly.xml

<?xml version="1.0" ?>
- <assembly>
  <listener
class="org.apache.avalon.cornerstone.blocks.transport.autopublishing.AutoPub
lisher" name="jaba-listener" />
- <!--
 The Storage block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager"
name="objectstorage" />
- <!--
 The Packet Manager block
  -->
- <block
class="org.apache.avalon.cornerstone.blocks.packet.DefaultPacketManager"
name="packet-manager">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <!--
 The ThreadManager block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager"
name="thread-manager" />
- <!--
 The Connection Manager block
  -->
- <block
class="org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionMana
ger" name="connections">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <!--
 The Socket Manager block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager"
name="sockets" />
- <!--
 The TimeScheduler block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.transport.authentication.Default
Authenticator" name="altrmi-authenticator" />
- <block
class="org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler"
name="scheduler">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <block
class="org.apache.avalon.cornerstone.blocks.transport.publishing.SocketStrea
mPublisher" name="jaba-publisher">
  <provide name="sockets"
role="org.apache.avalon.cornerstone.services.sockets.SocketManager" />
  <provide name="connections"
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>
  <provide name="altrmi-authenticator"
role="org.apache.excalibur.altrmi.server.AltrmiAuthenticator" />
  </block>
- <!--
 Below this section are the jabaserver
  -->
- <block class="org.novadeck.jabaserver.core.Server" name="jaba-server">
- <!--
 The names here must match the names specified for a Block in some conf.xml
file.
    The role should be the interface mentioned in the BlockInfo (.xinfo)
files
  -->
  <provide name="sockets"
role="org.apache.avalon.cornerstone.services.sockets.SocketManager" />
  <provide name="connections"
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>
  </block>
  </assembly>


Config.xml


- <config>
- <thread-manager>
- <thread-group>
  <name>default</name>
- <!--
 normal priority == 5, max-priority = 10
  -->
  <priority>5</priority>
- <!--
 are threads deamon threads ?
  -->
  <is-daemon>false</is-daemon>
  <max-threads>40</max-threads>
- <!--
 these are ignored at the moment but will be fixed in later revisions
  -->
  <min-threads>20</min-threads>
  <min-spare-threads>20</min-spare-threads>
  </thread-group>
  </thread-manager>
- <!--
 The Storage block
  -->
- <objectstorage>
- <repositories>
- <repository
class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Obje
ct_Repository">
- <protocols>
  <protocol>file</protocol>
  </protocols>
- <types>
  <type>OBJECT</type>
  </types>
- <models>
  <model>SYNCHRONOUS</model>
  <model>ASYNCHRONOUS</model>
  <model>CACHE</model>
  </models>
  </repository>
- <repository
class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Stre
am_Repository">
- <protocols>
  <protocol>file</protocol>
  </protocols>
- <types>
  <type>STREAM</type>
  </types>
- <models>
  <model>SYNCHRONOUS</model>
  <model>ASYNCHRONOUS</model>
  <model>CACHE</model>
  </models>
  </repository>
  </repositories>
  </objectstorage>
- <sockets>
- <server-sockets>
  <factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFacto
ry" />
  </server-sockets>
- <client-sockets>
  <factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory" />
  </client-sockets>
  </sockets>
  <altrmi-authenticator />
- <jaba-server>
  <port>5222</port>
  <bind>192.168.0.2</bind>
- <Jabahandler>
  <connectiontimeout>360000</connectiontimeout>
  </Jabahandler>
- <user-home-factory>

<implementation-class>org.novadeck.jabaserver.users.UserHomeDB</implementati
on-class>
  </user-home-factory>



----- Original Message -----
From: "Greg Steuck" <greg-avalon-apps-dev@nest.cx>
To: "Avalon Applications Developers List"
<avalon-apps-dev@jakarta.apache.org>
Sent: Wednesday, November 13, 2002 6:36 PM
Subject: Re: socket connection disappears


> >>>>> "Ed" == Ed Coughlin <ecoughlin@gollaborate.com> writes:
>
>     Ed> I cannot find any deliberate code in the client or server app
>     Ed> that deliberately closes the socket and all ioexceptions are
>     Ed> caught and logged as far as i can tell.
>
> org.apache.avalon.cornerstone.services.connection.ConnectionHandler
> as of revision 1.6 documents:
>
>     /**
>      * Processes connections as they occur. The handler should not
>      * close the <tt>connection</tt>, the caller will do that.
>      *
>      * @param connection the connection
>      * @exception IOException if an error reading from socket occurs
>      * @exception ProtocolException if an error handling connection occurs
>      */
>     void handleConnection( Socket connection )
>         throws IOException, ProtocolException;
>
> Could that be the reason your connections are getting closed?
>
> --
> To unsubscribe, e-mail:
<mailto:avalon-apps-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:avalon-apps-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:avalon-apps-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-apps-dev-help@jakarta.apache.org>


Mime
View raw message