Package anbxj
Class Channel_Server
java.lang.Object
anbxj.Channel_Abstraction
anbxj.Channel_Server
Server Channel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SocketThe client socket used for communication.protected static final AnBx_LayersThe layer associated with the network.protected ServerSocketThe server socket used for communication.Fields inherited from class anbxj.Channel_Abstraction
cp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose()Closes the server channel.voidOpen()Opens the server channel.protected voidopenClient(int port) Accepts a client connection and opens the stream.protected voidopenServerSocket(int port) Opens the server socket on the specified port.protected voidopenStream(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:
Openin classChannel_Abstraction
-
Close
public void Close()Closes the server channel.- Overrides:
Closein classChannel_Abstraction
-