congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BlockGuardOs.isLingerSocket
Code IndexAdd Tabnine to your IDE (free)

How to use
isLingerSocket
method
in
libcore.io.BlockGuardOs

Best Java code snippets using libcore.io.BlockGuardOs.isLingerSocket (Showing top 7 results out of 315)

origin: robovm/robovm

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: MobiVM/robovm

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: ibinti/bugvm

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: com.bugvm/bugvm-rt

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: com.gluonhq/robovm-rt

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: com.mobidevelop.robovm/robovm-rt

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
origin: FlexoVM/flexovm

@Override public void close(FileDescriptor fd) throws ErrnoException {
  try {
    if (S_ISSOCK(Libcore.os.fstat(fd).st_mode)) {
      if (isLingerSocket(fd)) {
        // If the fd is a socket with SO_LINGER set, we might block indefinitely.
        // We allow non-linger sockets so that apps can close their network
        // connections in methods like onDestroy which will run on the UI thread.
        BlockGuard.getThreadPolicy().onNetwork();
      }
      untagSocket(fd);
    }
  } catch (ErrnoException ignored) {
    // We're called via Socket.close (which doesn't ask for us to be called), so we
    // must not throw here, because Socket.close must not throw if asked to close an
    // already-closed socket. Also, the passed-in FileDescriptor isn't necessarily
    // a socket at all.
  }
  os.close(fd);
}
libcore.ioBlockGuardOsisLingerSocket

Popular methods of BlockGuardOs

  • tagSocket
  • untagSocket

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • Kernel (java.awt.image)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Notification (javax.management)
  • JList (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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