Package com.ericsson.otp.erlang
Class OtpServer
java.lang.Object
com.ericsson.otp.erlang.AbstractNode
com.ericsson.otp.erlang.OtpLocalNode
com.ericsson.otp.erlang.OtpSelf
com.ericsson.otp.erlang.OtpServer
- All Implemented Interfaces:
OtpTransportFactory
Deprecated.
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 explicitly
register with the port mapper daemon by calling
OtpSelf.publishPort()
.
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.
Setting up a connection may be done as follows:
OtpServer self = new OtpServer("server", "cookie"); // identify self self.publishPort(); // make port information available OtpConnection conn = self.accept(); // get incoming connection
- See Also:
-
Field Summary
Fields inherited from class com.ericsson.otp.erlang.OtpLocalNode
epmd, port
-
Constructor Summary
ConstructorDescriptionDeprecated.Create an OtpServer, using a vacant port chosen by the operating system.Deprecated.Create an OtpServer, using the specified port number. -
Method Summary
Methods inherited from class com.ericsson.otp.erlang.OtpSelf
accept, connect, pid, publishPort, unPublishPort
Methods inherited from class com.ericsson.otp.erlang.OtpLocalNode
createPid, createPort, createRef, getEpmd, port, setEpmd
Methods inherited from class com.ericsson.otp.erlang.AbstractNode
alive, cookie, createServerTransport, createServerTransport, createTransport, createTransport, createTransport, host, node, setCookie, toString
-
Constructor Details
-
OtpServer
Deprecated.- Parameters:
self
- an existing self node.- Throws:
IOException
- if a ServerSocket could not be created.
-
OtpServer
Deprecated.Create an OtpServer, using a vacant port chosen by the operating system. To determine what port was chosen, call the object'sOtpLocalNode.port()
method.- Parameters:
node
- the name of the node.cookie
- the authorization cookie that will be used by this node when accepts connections from remote nodes.- Throws:
IOException
- if a ServerSocket could not be created.
-
OtpServer
Deprecated.Create an OtpServer, using the specified port number.- Parameters:
node
- a name for this node, as above.cookie
- the authorization cookie that will be used by this node when accepts connections from remote nodes.port
- the port number to bind the socket to.- Throws:
IOException
- if a ServerSocket could not be created or if the chosen port number was not available.
-
OtpSelf
.