Tabnine Logo
TSocket.close
Code IndexAdd Tabnine to your IDE (free)

How to use
close
method
in
libthrift091.transport.TSocket

Best Java code snippets using libthrift091.transport.TSocket.close (Showing top 4 results out of 315)

origin: XiaoMi/galaxy-sdk-java

/**
 * Constructor that takes an already created socket.
 *
 * @param socket Already created socket object
 * @throws TTransportException if there is an error setting up the streams
 */
public TSocket(Socket socket) throws TTransportException {
 socket_ = socket;
 try {
  socket_.setSoLinger(false, 0);
  socket_.setTcpNoDelay(true);
 } catch (SocketException sx) {
  LOGGER.warn("Could not configure socket.", sx);
 }
 if (isOpen()) {
  try {
   inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
   outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
  } catch (IOException iox) {
   close();
   throw new TTransportException(TTransportException.NOT_OPEN, iox);
  }
 }
}
origin: com.xiaomi.infra.galaxy/galaxy-thrift-api

/**
 * Constructor that takes an already created socket.
 *
 * @param socket Already created socket object
 * @throws TTransportException if there is an error setting up the streams
 */
public TSocket(Socket socket) throws TTransportException {
 socket_ = socket;
 try {
  socket_.setSoLinger(false, 0);
  socket_.setTcpNoDelay(true);
 } catch (SocketException sx) {
  LOGGER.warn("Could not configure socket.", sx);
 }
 if (isOpen()) {
  try {
   inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
   outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
  } catch (IOException iox) {
   close();
   throw new TTransportException(TTransportException.NOT_OPEN, iox);
  }
 }
}
origin: com.xiaomi.infra.galaxy/galaxy-thrift-api

/**
 * Connects the socket, creating a new socket object if necessary.
 */
public void open() throws TTransportException {
 if (isOpen()) {
  throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected.");
 }
 if (host_.length() == 0) {
  throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host.");
 }
 if (port_ <= 0) {
  throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open without port.");
 }
 if (socket_ == null) {
  initSocket();
 }
 try {
  socket_.connect(new InetSocketAddress(host_, port_), timeout_);
  inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
  outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
 } catch (IOException iox) {
  close();
  throw new TTransportException(TTransportException.NOT_OPEN, iox);
 }
}
origin: XiaoMi/galaxy-sdk-java

/**
 * Connects the socket, creating a new socket object if necessary.
 */
public void open() throws TTransportException {
 if (isOpen()) {
  throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected.");
 }
 if (host_.length() == 0) {
  throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host.");
 }
 if (port_ <= 0) {
  throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open without port.");
 }
 if (socket_ == null) {
  initSocket();
 }
 try {
  socket_.connect(new InetSocketAddress(host_, port_), timeout_);
  inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
  outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
 } catch (IOException iox) {
  close();
  throw new TTransportException(TTransportException.NOT_OPEN, iox);
 }
}
libthrift091.transportTSocketclose

Javadoc

Closes the socket.

Popular methods of TSocket

  • <init>
    Constructor that takes an already created socket.
  • initSocket
    Initializes the socket object
  • isOpen
    Checks whether the socket is connected.
  • setTimeout
    Sets the socket timeout

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JButton (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • CodeWhisperer alternatives
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