<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_191) on Tue Feb 05 19:16:02 UTC 2019 --> <title>OtpServer (Java-Erlang Interface Library)</title> <meta name="date" content="2019-02-05"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="OtpServer (Java-Erlang Interface Library)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../com/ericsson/otp/erlang/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpServerSocketTransport.html" title="class in com.ericsson.otp.erlang"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpServer.html" target="_top">Frames</a></li> <li><a href="OtpServer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#fields.inherited.from.class.com.ericsson.otp.erlang.OtpLocalNode">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#methods.inherited.from.class.com.ericsson.otp.erlang.OtpSelf">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.ericsson.otp.erlang</div> <h2 title="Class OtpServer" class="title">Class OtpServer</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../com/ericsson/otp/erlang/AbstractNode.html" title="class in com.ericsson.otp.erlang">com.ericsson.otp.erlang.AbstractNode</a></li> <li> <ul class="inheritance"> <li><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">com.ericsson.otp.erlang.OtpLocalNode</a></li> <li> <ul class="inheritance"> <li><a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang">com.ericsson.otp.erlang.OtpSelf</a></li> <li> <ul class="inheritance"> <li>com.ericsson.otp.erlang.OtpServer</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../com/ericsson/otp/erlang/OtpTransportFactory.html" title="interface in com.ericsson.otp.erlang">OtpTransportFactory</a></dd> </dl> <hr> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <div class="block"><span class="deprecationComment">the functionality of this class has been moved to <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><code>OtpSelf</code></a> .</span></div> </div> <br> <pre>@Deprecated public class <span class="typeNameLabel">OtpServer</span> extends <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang">OtpSelf</a></pre> <div class="block">Represents a local OTP client or server node. It is used when you want other nodes to be able to establish connections to this one. When you create an instance of this class, it will bind a socket to a port so that incoming connections can be accepted. However the port number will not be made available to other nodes wishing to connect until you explicitely register with the port mapper daemon by calling <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#publishPort--"><code>OtpSelf.publishPort()</code></a>. <p> When the Java node will be connecting to a remote Erlang, Java or C node, it must first identify itself as a node by creating an instance of this class, after which it may connect to the remote node. <p> Setting up a connection may be done as follows: <pre> OtpServer self = new OtpServer("server", "cookie"); // identify self self.publishPort(); // make port information available OtpConnection conn = self.accept(); // get incoming connection </pre></div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><code>OtpSelf</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.com.ericsson.otp.erlang.OtpLocalNode"> <!-- --> </a> <h3>Fields inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">OtpLocalNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#epmd">epmd</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#port">port</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/ericsson/otp/erlang/OtpServer.html#OtpServer-com.ericsson.otp.erlang.OtpSelf-">OtpServer</a></span>(<a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang">OtpSelf</a> self)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an <a href="../../../../com/ericsson/otp/erlang/OtpServer.html" title="class in com.ericsson.otp.erlang"><code>OtpServer</code></a> from an existing <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><code>OtpSelf</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/ericsson/otp/erlang/OtpServer.html#OtpServer-java.lang.String-java.lang.String-">OtpServer</a></span>(java.lang.String node, java.lang.String cookie)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an OtpServer, using a vacant port chosen by the operating system.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/ericsson/otp/erlang/OtpServer.html#OtpServer-java.lang.String-java.lang.String-int-">OtpServer</a></span>(java.lang.String node, java.lang.String cookie, int port)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an OtpServer, using the specified port number.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.ericsson.otp.erlang.OtpSelf"> <!-- --> </a> <h3>Methods inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang">OtpSelf</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#accept--">accept</a>, <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#connect-com.ericsson.otp.erlang.OtpPeer-">connect</a>, <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#pid--">pid</a>, <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#publishPort--">publishPort</a>, <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html#unPublishPort--">unPublishPort</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.ericsson.otp.erlang.OtpLocalNode"> <!-- --> </a> <h3>Methods inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">OtpLocalNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createPid--">createPid</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createPort--">createPort</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createRef--">createRef</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#getEpmd--">getEpmd</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#port--">port</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#setEpmd-com.ericsson.otp.erlang.OtpTransport-">setEpmd</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.ericsson.otp.erlang.AbstractNode"> <!-- --> </a> <h3>Methods inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/AbstractNode.html" title="class in com.ericsson.otp.erlang">AbstractNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#alive--">alive</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#cookie--">cookie</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#createServerTransport-int-">createServerTransport</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#createTransport-java.net.InetAddress-int-">createTransport</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#createTransport-java.lang.String-int-">createTransport</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#host--">host</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#node--">node</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#setCookie-java.lang.String-">setCookie</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#toString--">toString</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="OtpServer-com.ericsson.otp.erlang.OtpSelf-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpServer</h4> <pre>public OtpServer(<a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang">OtpSelf</a> self) throws java.io.IOException</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an <a href="../../../../com/ericsson/otp/erlang/OtpServer.html" title="class in com.ericsson.otp.erlang"><code>OtpServer</code></a> from an existing <a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><code>OtpSelf</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>self</code> - an existing self node.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code> - if a ServerSocket could not be created.</dd> </dl> </li> </ul> <a name="OtpServer-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpServer</h4> <pre>public OtpServer(java.lang.String node, java.lang.String cookie) throws java.io.IOException</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an OtpServer, using a vacant port chosen by the operating system. To determine what port was chosen, call the object's <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#port--"><code>OtpLocalNode.port()</code></a> method.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>node</code> - the name of the node.</dd> <dd><code>cookie</code> - the authorization cookie that will be used by this node when accepts connections from remote nodes.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code> - if a ServerSocket could not be created.</dd> </dl> </li> </ul> <a name="OtpServer-java.lang.String-java.lang.String-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>OtpServer</h4> <pre>public OtpServer(java.lang.String node, java.lang.String cookie, int port) throws java.io.IOException</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> <div class="block">Create an OtpServer, using the specified port number.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>node</code> - a name for this node, as above.</dd> <dd><code>cookie</code> - the authorization cookie that will be used by this node when accepts connections from remote nodes.</dd> <dd><code>port</code> - the port number to bind the socket to.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code> - if a ServerSocket could not be created or if the chosen port number was not available.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../com/ericsson/otp/erlang/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/ericsson/otp/erlang/OtpSelf.html" title="class in com.ericsson.otp.erlang"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpServerSocketTransport.html" title="class in com.ericsson.otp.erlang"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpServer.html" target="_top">Frames</a></li> <li><a href="OtpServer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#fields.inherited.from.class.com.ericsson.otp.erlang.OtpLocalNode">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#methods.inherited.from.class.com.ericsson.otp.erlang.OtpSelf">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>