程序包 web_tools

类 TransmissionController

java.lang.Object
web_tools.TransmissionController
所有已实现的接口:
Closeable, AutoCloseable

public class TransmissionController extends Object implements Closeable
A proxy class that can be used to send and receive messages.
版本:
beta1.1
另请参阅:
  • 构造器详细资料

    • TransmissionController

      public TransmissionController(Socket targetSocket, TransmissionListener listener) throws IOException, NullPointerException
      Constructor of the transmission proxy TransmissionController
      参数:
      targetSocket - The socket your program plugged
      listener - 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 parameter serverSocket, this exception will appear.
  • 方法详细资料

    • send

      public <T extends Serializable> void send(T data)
      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

      public void close() throws IOException
      指定者:
      close 在接口中 AutoCloseable
      指定者:
      close 在接口中 Closeable
      抛出:
      IOException - When exception happens on closing the instances of receiver and sender, the exception will appear.