类 UdpClient

java.lang.Object
com.weicoder.common.socket.UdpClient

public final class UdpClient extends Object
UDP 客户端发包处理器
作者:
WD
  • 方法概要

    修饰符和类型
    方法
    说明
    static void
    send(String host, int port, byte[] data)
    bio模式发送数据 不接收返回数据
    static byte[]
    send(String host, int port, byte[] data, int len)
    bio模式发送数据 接收返回数据
    static void
    write(String host, int port, byte[] data)
    nio模式发送数据
    static byte[]
    write(String host, int port, byte[] data, int len)
    nio模式发送数据 接收返回数据

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • send

      public static void send(String host, int port, byte[] data)
      bio模式发送数据 不接收返回数据
      参数:
      host - 服务器主机
      port - 服务器端口
      data - 发送数据
    • send

      public static byte[] send(String host, int port, byte[] data, int len)
      bio模式发送数据 接收返回数据
      参数:
      host - 服务器主机
      port - 服务器端口
      data - 发送数据
      len - 接收返回数据长度
      返回:
      接收的数据
    • write

      public static void write(String host, int port, byte[] data)
      nio模式发送数据
      参数:
      host - 服务器主机
      port - 服务器端口
      data - 发送数据
    • write

      public static byte[] write(String host, int port, byte[] data, int len)
      nio模式发送数据 接收返回数据
      参数:
      host - 服务器主机
      port - 服务器端口
      data - 发送数据
      len - 接收返回数据长度
      返回:
      接收的数据