Package org.openmuc.jdlms
Class DlmsServer
- java.lang.Object
-
- org.openmuc.jdlms.DlmsServer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DlmsServer extends java.lang.Object implements java.lang.AutoCloseable
Class representing a physical device (DLMS/COSEM server).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DlmsServer.TcpServerBuilder
Builder to create a TCP physical device/server.static class
DlmsServer.TcpServerSettingsImpl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Stops the server immediately.void
shutdown()
Sends disconnect messages to all connected clients.static DlmsServer.TcpServerBuilder
tcpServerBuilder()
Create a new TCP server builder.static DlmsServer.TcpServerBuilder
tcpServerBuilder(int port)
Create a new TCP server builder.
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Stops the server immediately. Releases all acquired resources.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
-
shutdown
public void shutdown() throws java.io.IOException
Sends disconnect messages to all connected clients.- Throws:
java.io.IOException
- if an exception occurs, while releasing the resources.
-
tcpServerBuilder
public static DlmsServer.TcpServerBuilder tcpServerBuilder(int port)
Create a new TCP server builder.- Parameters:
port
- the TCP port the server starts listening on.- Returns:
- a new TcpServerBuilder.
-
tcpServerBuilder
public static DlmsServer.TcpServerBuilder tcpServerBuilder()
Create a new TCP server builder. Opening the defaut DLMS port 4059.- Returns:
- a new TcpServerBuilder.
-
-