Package anbxj
Class Channel_Server
java.lang.Object
anbxj.Channel_Abstraction
anbxj.Channel_Server
Server Channel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Socket
The client socket used for communication.protected static final AnBx_Layers
The layer associated with the network.protected ServerSocket
The server socket used for communication.Fields inherited from class anbxj.Channel_Abstraction
cp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close()
Closes the server channel.void
Open()
Opens the server channel.protected void
openClient
(int port) Accepts a client connection and opens the stream.protected void
openServerSocket
(int port) Opens the server socket on the specified port.protected void
openStream
(int port) Opens the stream based on the channel type.Methods inherited from class anbxj.Channel_Abstraction
checkPort, getChannelRole, OpenStreams, Receive, Receive, safeReadObject, Send
-
Field Details
-
server
The server socket used for communication. -
client
The client socket used for communication. -
layer
The layer associated with the network.
-
-
Constructor Details
-
Channel_Server
Constructor for Channel_Server.- Parameters:
cp
- The Channel_Properties.
-
-
Method Details
-
openServerSocket
protected void openServerSocket(int port) Opens the server socket on the specified port.- Parameters:
port
- The port to open the server socket.
-
openClient
protected void openClient(int port) Accepts a client connection and opens the stream.- Parameters:
port
- The port to open the client connection.
-
openStream
protected void openStream(int port) Opens the stream based on the channel type.- Parameters:
port
- The port to open the stream.
-
Open
public void Open()Opens the server channel.- Overrides:
Open
in classChannel_Abstraction
-
Close
public void Close()Closes the server channel.- Overrides:
Close
in classChannel_Abstraction
-