java.net.SocketException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中java.net.SocketException.getLocalizedMessage()方法的一些代码示例,展示了SocketException.getLocalizedMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SocketException.getLocalizedMessage()方法的具体详情如下:
包路径:java.net.SocketException
类名称:SocketException
方法名:getLocalizedMessage

SocketException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: groboclown/p4ic4idea

public int getSystemRecvBufferSize() {
  if (nonNull(socket)) {
    try {
      return socket.getReceiveBufferSize();
    } catch (SocketException exc) {
      Log.error("unexpected exception: %s", exc.getLocalizedMessage());
      Log.exception(exc);
    }
  }
  return 0;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public static IRubyObject ip_address_list(ThreadContext context) {
  Ruby runtime = context.runtime;
  try {
    RubyArray list = RubyArray.newArray(runtime);
    RubyClass addrInfoCls = runtime.getClass("Addrinfo");
    for (Enumeration<NetworkInterface> networkIfcs = NetworkInterface.getNetworkInterfaces() ; networkIfcs.hasMoreElements() ; ) {
      for (Enumeration<InetAddress> addresses = networkIfcs.nextElement().getInetAddresses() ; addresses.hasMoreElements() ; ) {
        list.append(new Addrinfo(runtime, addrInfoCls, addresses.nextElement()));
      }
    }
    return list;
  } catch (SocketException se) {
    throw sockerr(runtime, se.getLocalizedMessage());
  }
}

代码示例来源:origin: com.perforce/p4java

public int getSystemRecvBufferSize() {
  if (nonNull(socket)) {
    try {
      return socket.getReceiveBufferSize();
    } catch (SocketException exc) {
      Log.error("unexpected exception: %s", exc.getLocalizedMessage());
      Log.exception(exc);
    }
  }
  return 0;
}

代码示例来源:origin: org.jruby/jruby-complete

public static IRubyObject ip_address_list(ThreadContext context) {
  Ruby runtime = context.runtime;
  try {
    RubyArray list = RubyArray.newArray(runtime);
    RubyClass addrInfoCls = runtime.getClass("Addrinfo");
    for (Enumeration<NetworkInterface> networkIfcs = NetworkInterface.getNetworkInterfaces() ; networkIfcs.hasMoreElements() ; ) {
      for (Enumeration<InetAddress> addresses = networkIfcs.nextElement().getInetAddresses() ; addresses.hasMoreElements() ; ) {
        list.append(new Addrinfo(runtime, addrInfoCls, addresses.nextElement()));
      }
    }
    return list;
  } catch (SocketException se) {
    throw sockerr(runtime, se.getLocalizedMessage());
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static IRubyObject ip_address_list(ThreadContext context) {
  Ruby runtime = context.runtime;
  try {
    RubyArray list = RubyArray.newArray(runtime);
    RubyClass addrInfoCls = runtime.getClass("Addrinfo");
    for (Enumeration<NetworkInterface> networkIfcs = NetworkInterface.getNetworkInterfaces() ; networkIfcs.hasMoreElements() ; ) {
      for (Enumeration<InetAddress> addresses = networkIfcs.nextElement().getInetAddresses() ; addresses.hasMoreElements() ; ) {
        list.append(new Addrinfo(runtime, addrInfoCls, addresses.nextElement()));
      }
    }
    return list;
  } catch (SocketException se) {
    throw sockerr(runtime, se.getLocalizedMessage());
  }
}

代码示例来源:origin: com.perforce/p4java

public int getSystemSendBufferSize() {
  if (nonNull(socket)) {
    try {
      return socket.getSendBufferSize();
    } catch (SocketException exc) {
      Log.error("unexpected exception: %s", exc.getLocalizedMessage());
      Log.exception(exc);
    }
  }
  return 0;
}

代码示例来源:origin: org.jruby/jruby-core

public static IRubyObject ip_address_list(ThreadContext context) {
  Ruby runtime = context.runtime;
  try {
    RubyArray list = RubyArray.newArray(runtime);
    RubyClass addrInfoCls = runtime.getClass("Addrinfo");
    for (Enumeration<NetworkInterface> networkIfcs = NetworkInterface.getNetworkInterfaces() ; networkIfcs.hasMoreElements() ; ) {
      for (Enumeration<InetAddress> addresses = networkIfcs.nextElement().getInetAddresses() ; addresses.hasMoreElements() ; ) {
        list.append(new Addrinfo(runtime, addrInfoCls, addresses.nextElement()));
      }
    }
    return list;
  } catch (SocketException se) {
    throw sockerr(runtime, se.getLocalizedMessage());
  }
}

代码示例来源:origin: groboclown/p4ic4idea

public int getSystemSendBufferSize() {
  if (nonNull(socket)) {
    try {
      return socket.getSendBufferSize();
    } catch (SocketException exc) {
      Log.error("unexpected exception: %s", exc.getLocalizedMessage());
      Log.exception(exc);
    }
  }
  return 0;
}

代码示例来源:origin: wolpi/prim-ftpd

logger.info("exception while iterating network interfaces", e);
String msg = ctxt.getText(R.string.ifacesError) + e.getLocalizedMessage();
Toast.makeText(ctxt, msg, Toast.LENGTH_SHORT).show();

代码示例来源:origin: org.jredis/jredis-core-ri

/**
   * Writes the entire content of the message to the output stream and flushes it.
   * 
   * @param out the stream to write the Request message to.
   */
  @Override
  public void write(OutputStream out) throws ClientRuntimeException, ProviderException {
    try {
      // you would expect these to throw exceptions if the socket has been reset
      // but they don't.  
      buffer.writeTo(out);
      out.flush();
    }
    catch (SocketException e){
      Log.error("StreamBufferRequest.write(): SocketException on write: " + e.getLocalizedMessage());
      throw new ClientRuntimeException ("socket exception", e);
    }
    catch (IOException e) { 
      Log.error("StreamBufferRequest.write(): IOException on write: " + e.getLocalizedMessage());
      throw new ClientRuntimeException ("stream io exception", e);
    }
  }
}

代码示例来源:origin: alphazero/jredis

/**
   * Writes the entire content of the message to the output stream and flushes it.
   * 
   * @param out the stream to write the Request message to.
   */
  @Override
  public void write(OutputStream out) throws ClientRuntimeException, ProviderException {
    try {
      // you would expect these to throw exceptions if the socket has been reset
      // but they don't.  
      buffer.writeTo(out);
      out.flush();
    }
    catch (SocketException e){
      Log.error("StreamBufferRequest.write(): SocketException on write: " + e.getLocalizedMessage());
      throw new ClientRuntimeException ("socket exception", e);
    }
    catch (IOException e) { 
      Log.error("StreamBufferRequest.write(): IOException on write: " + e.getLocalizedMessage());
      throw new ClientRuntimeException ("stream io exception", e);
    }
  }
}

代码示例来源:origin: org.jredis/jredis-anthonylauzon

/**
     * Writes the entire content of the message to the output stream and flushes it.
     * 
     * @param out the stream to write the Request message to.
     */
//        @Override
    public void write(OutputStream out) throws ClientRuntimeException, ProviderException {
      try {
        // you would expect these to throw exceptions if the socket has been reset
        // but they don't.  
        buffer.writeTo(out);
        out.flush();
      }
      catch (SocketException e){
        Log.error("StreamBufferRequest.write(): SocketException on write: " + e.getLocalizedMessage());
        throw new ClientRuntimeException ("socket exception", e);
      }
      catch (IOException e) { 
        Log.error("StreamBufferRequest.write(): IOException on write: " + e.getLocalizedMessage());
        throw new ClientRuntimeException ("stream io exception", e);
      }
    }
  }

代码示例来源:origin: org.shoal/shoal-gms-impl

shoalLogger.log(Level.WARNING, "grizzlynetmgr.invalidbindaddr", new Object[]{ex.getLocalizedMessage()});

代码示例来源:origin: org.glassfish.shoal/shoal-gms-impl

shoalLogger.log(Level.WARNING, "grizzlynetmgr.invalidbindaddr", new Object[]{ex.getLocalizedMessage()});

代码示例来源:origin: iipc/openwayback

throw new LiveWebCacheUnavailableException( e.getLocalizedMessage() +
    " : " + urlStr );

代码示例来源:origin: org.netpreserve.openwayback/openwayback-core

throw new LiveWebCacheUnavailableException( e.getLocalizedMessage() +
    " : " + urlStr );

代码示例来源:origin: org.openehealth.ipf.oht.atna/ipf-oht-atna-nodeauth

+ (CONTEXT.getConfig().getSocketRetries() - retries) +" retries left. Cause: "+e.getLocalizedMessage(),e);

代码示例来源:origin: iipc/openwayback

+ " : " + urlString);
} catch (SocketException e) {
  throw new LiveWebCacheUnavailableException(e.getLocalizedMessage() 
      + " : " + urlString);
} catch (SocketTimeoutException e) {

代码示例来源:origin: org.netpreserve.openwayback/openwayback-core

+ " : " + urlString);
} catch (SocketException e) {
  throw new LiveWebCacheUnavailableException(e.getLocalizedMessage() 
      + " : " + urlString);
} catch (SocketTimeoutException e) {

代码示例来源:origin: Refinitiv/Elektron-SDK

error.errorId(TransportReturnCodes.FAILURE);
error.sysError(0);
error.text(e.getLocalizedMessage());

相关文章