程序包 web_tools
类 TransmissionController
java.lang.Object
web_tools.TransmissionController
- 所有已实现的接口:
Closeable,AutoCloseable
A proxy class that can be used to send and receive messages.
- 版本:
- beta1.1
- 另请参阅:
-
TransmissionListenerSenderReceiverSerializableObjectOutputStream
-
构造器概要
构造器构造器说明TransmissionController(Socket targetSocket, TransmissionListener listener) Constructor of the transmission proxyTransmissionController -
方法概要
修饰符和类型方法说明voidclose()<T extends Serializable>
voidsend(T data) Send the message to the socket it connect to.
-
构造器详细资料
-
TransmissionController
public TransmissionController(Socket targetSocket, TransmissionListener listener) throws IOException, NullPointerException Constructor of the transmission proxyTransmissionController- 参数:
targetSocket- The socket your program pluggedlistener- An instance you want to present. TransmissionListener.java- 抛出:
NullPointerException- If the parameters you pass are all non-initialized variables, the exception will appear.IOException- If there exists IOException in the input or output stream of the parameterserverSocket, this exception will appear.
-
-
方法详细资料
-
send
Send the message to the socket it connect to.- 类型参数:
T- The class type of the message you want to send. Use template to make the class more flexible and easy to use. Serializable.java- 参数:
data- Should be serialised! The message you want to send.
-
close
- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 抛出:
IOException- When exception happens on closing the instances of receiver and sender, the exception will appear.
-