public abstract class UDPSocket extends Port
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
Constructor and Description |
---|
UDPSocket() |
Modifier and Type | Method and Description |
---|---|
int |
available()
If no bytes are available from the existing input stream, then this method will read a complete new packet.
|
void |
close()
This will close the socket and the streams.
|
int |
getReceiveBufferSize()
Returns the receiveBufferSize for the current socket.
|
int |
read()
Forces a packet read with
available() and then calls the superclass. |
int |
read(byte[] b)
Forces a packet read with
available() and then calls the superclass. |
int |
read(byte[] b,
int off,
int len)
Forces a packet read with
available() and then calls the superclass. |
byte[] |
readAndWait(int length,
int timeout,
int interCharacterTimeout)
This method returns a copy of the byte array from the socket.
|
void |
write(byte[] b)
Pass through to
write(b, offset, length) . |
getInputStream, getName, getOutputStream, getPort, getPortPool, hasError, readCurrent, setError, setInputStream, setOutputStream, setPortPool, setThread, write, write
public static final java.lang.String cvsRev
public int available() throws java.io.IOException
available
in interface PortInterface
available
in class Port
java.io.IOException
vib.utils.PortInterface#available()
public void close()
public int getReceiveBufferSize()
public int read() throws java.io.IOException
available()
and then calls the superclass.read
in interface PortInterface
read
in class Port
java.io.IOException
vib.utils.PortInterface#read()
public int read(byte[] b) throws java.io.IOException
available()
and then calls the superclass.read
in interface PortInterface
read
in class Port
java.io.IOException
vib.utils.PortInterface#read(byte[])
public int read(byte[] b, int off, int len) throws java.io.IOException
available()
and then calls the superclass.read
in interface PortInterface
read
in class Port
java.io.IOException
vib.utils.PortInterface#read(byte[], int, int)
public byte[] readAndWait(int length, int timeout, int interCharacterTimeout) throws java.io.IOException
timeout
expires then the method returns null.readAndWait
in interface PortInterface
readAndWait
in class Port
length
- this is ignored provided that it is less than socket.getReceiveBufferSize()timeout
- the soTimeout of the socket is set to this value before receive is called.interCharacterTimeout
- this parameter is ignoredlength
if the interCharacterTimeout expired. It will be
null if the timeout expired.java.io.IOException
- thrown by the underlying portvib.utils.PortInterface#readAndWait(int, int, int)
public void write(byte[] b) throws java.io.IOException
write(b, offset, length)
.write
in interface PortInterface
write
in class Port
java.io.IOException
vib.utils.PortInterface#write(byte[])
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.