public class UdpReceive extends Object implements AutoCloseable
Constructor and Description |
---|
UdpReceive(int port) |
Modifier and Type | Method and Description |
---|---|
UdpReceive |
bufferSize(int bufferSize) |
void |
close() |
DatagramSocket |
getDatagramSocket() |
int |
getPort() |
int |
receive(byte[] bs) |
int |
receive(byte[] bs,
int len) |
int |
receive(byte[] bs,
int off,
int len) |
DatagramPacket |
receivePacket(byte[] bs) |
DatagramPacket |
receivePacket(byte[] bs,
int len) |
DatagramPacket |
receivePacket(byte[] bs,
int off,
int len) |
UdpReceive |
timeout(int timeOut) |
public UdpReceive(int port) throws IOException
IOException
public UdpReceive bufferSize(int bufferSize) throws SocketException
SocketException
public UdpReceive timeout(int timeOut) throws SocketException
SocketException
public int receive(byte[] bs) throws IOException
IOException
public int receive(byte[] bs, int len) throws IOException
IOException
public int receive(byte[] bs, int off, int len) throws IOException
IOException
public DatagramPacket receivePacket(byte[] bs) throws IOException
IOException
public DatagramPacket receivePacket(byte[] bs, int len) throws IOException
IOException
public DatagramPacket receivePacket(byte[] bs, int off, int len) throws IOException
IOException
public void close()
close
in interface AutoCloseable
public int getPort()
public DatagramSocket getDatagramSocket()
Copyright © 2024. All rights reserved.