title: How to serve a socket from a Java EE application?
body: <p>We would like to serve some client requests within our Java EE application server (JBoss 4.2.3). I read that the <a href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/ejb_tier/qanda/restrictions.html" rel="noreferrer">Java EE spec doesn't allow opening a socket from an enterprise bean</a>. But the spec suggests no alternatives.</p>
  
  <blockquote>
    <p>Specifically, enterprise beans should not: </p>
    
    <ul>
    <li>listen on, accept connections on, or multicast from a network socket</li>
    </ul>
  </blockquote>
  
  <p>So the question is: What can I do to serve some <strong>binary</strong> tcp based protocols (not http) from within an application server? </p>
  
  <p><a href="http://www.theserverside.com/discussions/thread.tss?thread_id=10374" rel="noreferrer">Here</a> someone suggests to implement a <a href="http://java.sun.com/developer/technicalArticles/J2EE/connectorclient/resourceadapter.html" rel="noreferrer">resource adapter</a>. Is this the way you have to go or are there other (easier) solutions?</p>