java.net.Socket.toString()方法的使用及代码示例

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

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

Socket.toString介绍

[英]Returns a String containing a concise, human-readable description of the socket.
[中]返回一个字符串,其中包含套接字的简明易读描述。

代码示例

代码示例来源:origin: apache/zookeeper

public String getQuorumAddress() {
  return follower.sock.toString();
}

代码示例来源:origin: aws/aws-sdk-java

@Override
public String toString() {
  return sock.toString();
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

public String getQuorumAddress() {
  return follower.sock.toString();
}

代码示例来源:origin: apache/zookeeper

public String getQuorumAddress() {
  return observer.getSocket().toString();
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

public String getQuorumAddress() {
  return observer.getSocket().toString();
}

代码示例来源:origin: apache/zookeeper

/**
 * See {@link Socket#toString()}. Calling this method does not trigger mode detection.
 */
@Override
public String toString() {
  return "UnifiedSocket[mode=" + mode.toString() + "socket=" + getSocketAllowUnknownMode().toString() + "]";
}

代码示例来源:origin: apache/nifi

sChannel.configureBlocking(false);
final SelectionKey socketChannelKey = sChannel.register(socketChannelSelector, SelectionKey.OP_READ);
final String readerId = sChannel.socket().toString();
reader = new SocketChannelReader(readerId, socketChannelKey, emptyBuffers, factory);
final ScheduledFuture<?> readerFuture = executor.scheduleWithFixedDelay(reader, 10L,

代码示例来源:origin: igniterealtime/Openfire

Socket sock = serverSocket.accept();
if (sock != null) {
  Log.debug("Connect " + sock.toString());

代码示例来源:origin: apache/zookeeper

public void run() {
  Thread.currentThread().setName(toClose.toString() + "-->"
      + toClose2.toString());
  byte[] buf = new byte[1024];
  try {

代码示例来源:origin: igniterealtime/Openfire

Log.warn(LocaleUtils.getLocalizedString("admin.error.connection") + socket.toString());
Log.debug(LocaleUtils.getLocalizedString("admin.error.connection") + socket.toString());

代码示例来源:origin: stackoverflow.com

return delegate.toString();

代码示例来源:origin: stackoverflow.com

return delegate.toString();

代码示例来源:origin: stackoverflow.com

return delegate.toString();

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public String toString() {
return socket.toString();
}

代码示例来源:origin: spring-projects/spring-integration

@Override
public String toString() {
  return this.socket.toString();
}

代码示例来源:origin: com.sun.mail/javax.mail

@Override
public String toString() {
return socket.toString();
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

@Override
public String toString() {
  return sock.toString();
}

代码示例来源:origin: apache/cloudstack

protected void read(final SelectionKey key) throws IOException {
  final Link link = (Link)key.attachment();
  try {
    final SocketChannel socketChannel = (SocketChannel)key.channel();
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("Reading from: " + socketChannel.socket().toString());
    }
    final byte[] data = link.read(socketChannel);
    if (data == null) {
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("Packet is incomplete.  Waiting for more.");
      }
      return;
    }
    final Task task = _factory.create(Task.Type.DATA, link, data);
    try {
      _executor.submit(task);
    } catch (final Exception e) {
      s_logger.warn("Exception occurred when submitting the task", e);
    }
  } catch (final Exception e) {
    logDebug(e, key, 1);
    terminate(key);
  }
}

代码示例来源:origin: org.mobicents.diameter/jdiameter-impl

public void initialize(Socket socket) throws IOException, NotInitializedException  {
 logger.debug("Initialising TCPTransportClient for a socket on [{}]", socket);
 socketDescription = socket.toString();
 socketChannel = socket.getChannel();
 //PCB added logging
 socketChannel.configureBlocking(BLOCKING_IO);
 destAddress = new InetSocketAddress(socket.getInetAddress(), socket.getPort());
}

代码示例来源:origin: org.ow2.petals/petals-kernel

public void onConnectionIsAccepted(final SocketChannel socketChannel, final Selector selector)
    throws IOException {
  this.log.info("A connection is accepted: " + socketChannel.socket().toString());
  final PipedDeserializer deserializer = new PipedDeserializerImpl(socketChannel,
      this.messageReceiver, this.logger, this.log);
  this.deserializationTasks.put(socketChannel, deserializer);
  socketChannel.register(selector, SelectionKey.OP_READ, new InputSocketChannelContext(
      socketChannel, deserializer, this));
}

相关文章