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

How to use
BlockGuardOs
in
libcore.io

Best Java code snippets using libcore.io.BlockGuardOs (Showing top 20 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: robovm/robovm

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
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: robovm/robovm

@Override public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
  return tagSocket(os.socket(domain, type, protocol));
}
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: robovm/robovm

@Override public FileDescriptor accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketException {
  BlockGuard.getThreadPolicy().onNetwork();
  return tagSocket(os.accept(fd, peerAddress));
}
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: MobiVM/robovm

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
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);
}
origin: ibinti/bugvm

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
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.mobidevelop.robovm/robovm-rt

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
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: FlexoVM/flexovm

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
origin: com.bugvm/bugvm-rt

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
origin: com.gluonhq/robovm-rt

@Override public void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException {
  os.socketpair(domain, type, protocol, fd1, fd2);
  tagSocket(fd1);
  tagSocket(fd2);
}
origin: MobiVM/robovm

@Override public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
  return tagSocket(os.socket(domain, type, protocol));
}
origin: ibinti/bugvm

@Override public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
  return tagSocket(os.socket(domain, type, protocol));
}
origin: com.gluonhq/robovm-rt

@Override public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
  return tagSocket(os.socket(domain, type, protocol));
}
origin: com.bugvm/bugvm-rt

@Override public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
  return tagSocket(os.socket(domain, type, protocol));
}
libcore.ioBlockGuardOs

Javadoc

Informs BlockGuard of any activity it should be aware of.

Most used methods

  • isLingerSocket
  • tagSocket
  • untagSocket

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for WebStorm
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