Tabnine Logo
Session.isClose
Code IndexAdd Tabnine to your IDE (free)

How to use
isClose
method
in
sockslib.server.Session

Best Java code snippets using sockslib.server.Session.isClose (Showing top 2 results out of 315)

origin: theotherp/nzbhydra2

@Override
public void doUDPAssociate(Session session, CommandMessage commandMessage) throws
    SocksException, IOException {
  UDPRelayServer udpRelayServer =
      new UDPRelayServer(((InetSocketAddress) session.getClientAddress()).getAddress(),
          commandMessage.getPort());
  InetSocketAddress socketAddress = (InetSocketAddress) udpRelayServer.start();
  logger.info("Create UDP relay server at[{}] for {}", socketAddress, commandMessage
      .getSocketAddress());
  session.write(new CommandResponseMessage(VERSION, ServerReply.SUCCEEDED, InetAddress
      .getLocalHost(), socketAddress.getPort()));
  while (udpRelayServer.isRunning()) {
    try {
      Thread.sleep(idleTime);
    } catch (InterruptedException e) {
      session.close();
      logger.info("Session[{}] closed", session.getId());
    }
    if (session.isClose()) {
      udpRelayServer.stop();
      logger.debug("UDP relay server for session[{}] is closed", session.getId());
    }
  }
}
origin: fengyouchao/sockslib

@Override
public void doUDPAssociate(Session session, CommandMessage commandMessage) throws
  SocksException, IOException {
 UDPRelayServer udpRelayServer =
   new UDPRelayServer(((InetSocketAddress) session.getClientAddress()).getAddress(),
     commandMessage.getPort());
 InetSocketAddress socketAddress = (InetSocketAddress) udpRelayServer.start();
 logger.info("Create UDP relay server at[{}] for {}", socketAddress, commandMessage
   .getSocketAddress());
 session.write(new CommandResponseMessage(VERSION, ServerReply.SUCCEEDED, InetAddress
   .getLocalHost(), socketAddress.getPort()));
 while (udpRelayServer.isRunning()) {
  try {
   Thread.sleep(idleTime);
  } catch (InterruptedException e) {
   session.close();
   logger.info("Session[{}] closed", session.getId());
  }
  if (session.isClose()) {
   udpRelayServer.stop();
   logger.debug("UDP relay server for session[{}] is closed", session.getId());
  }
 }
}
sockslib.serverSessionisClose

Javadoc

Returns true if the session is closed.

Popular methods of Session

  • close
    Closes connection and removes itself from managed sessions.
  • getClientAddress
    Get remote host's IP address and port.
  • getId
    Gets session ID.
  • getSocket
    Returns socket.
  • read
    Read a buffer.
  • setAttribute
  • write
    Writes bytes in output stream.

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now