Class PTPModule

java.lang.Object
io.github.michael_bailey.client.managers.NetworkModules.PTPModule

public class PTPModule
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    PTPModule​(NetworkManager manager, int port)  
  • Method Summary

    Modifier and Type Method Description
    void ptpThreadWorkerFn​(java.net.Socket socket)
    ptpThreadWorkerFn this is called when a io.github.michael_bailey.client connects to this process for peer to peer communication it first asks for a request (simalar to a server).
    boolean start()
    ptpStart this will create a new server socket and ptp thread it the cretes a new thread pool for incoming connection's then proceds to start the ptp thread.
    void stop()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • ptpThreadWorkerFn

      public void ptpThreadWorkerFn​(java.net.Socket socket)
      ptpThreadWorkerFn this is called when a io.github.michael_bailey.client connects to this process for peer to peer communication it first asks for a request (simalar to a server). after wich the io.github.michael_bailey.client should send the data over. to which it will respond with success for fail.
      Parameters:
      socket - the new connection
    • start

      public boolean start()
      ptpStart this will create a new server socket and ptp thread it the cretes a new thread pool for incoming connection's then proceds to start the ptp thread.
      Returns:
      a boolean is returned if the ptp module started correctly
    • stop

      public void stop()