|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.epam.common.transport.client.udp.UDPTransport
public class UDPTransport
UDP transport implementation.
Constructor Summary | |
---|---|
UDPTransport()
Creates UDP transport. |
|
UDPTransport(String multicastAddress,
int port)
Creates UDP transport. |
Method Summary | |
---|---|
void |
close()
Closes the transport. |
String |
getAddress()
Getter for address value. |
int |
getPort()
Getter for port value. |
boolean |
isBlockingSocket()
|
boolean |
isOpen()
Returns true if, transport is open. |
void |
open()
Method opens the transport. |
int |
read(byte[] buffer)
Transport dependent read method. |
int |
read(byte[] buffer,
int offset,
int length)
Transport dependent read method. |
int |
read(ByteBuffer buffer)
|
int |
read(ByteBuffer buffer,
int offset,
int length)
|
void |
setAddress(String multicastAddress)
Setter for multicat address. |
void |
setBufferSize(int bufferSize)
|
void |
setNetworkInterfaceName(String networkInterface)
Setter for network interface. |
void |
setPort(int port)
Setter for port. |
void |
setSocketFactory(SocketFactory socketFactory)
|
void |
waitUntilReadyToWrite()
|
void |
write(byte[] message)
Transport dependent write method. |
int |
write(byte[] message,
int offset,
int length)
Transport dependent write method. |
int |
write(ByteBuffer buffer)
|
int |
write(ByteBuffer buffer,
int offset,
int length)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UDPTransport()
public UDPTransport(String multicastAddress, int port)
multicastAddress
- the multicast addressport
- the transport portMethod Detail |
---|
public void setSocketFactory(SocketFactory socketFactory)
setSocketFactory
in interface ClientTransport
public boolean isBlockingSocket()
isBlockingSocket
in interface Transport
public void setNetworkInterfaceName(String networkInterface)
networkInterface
- public void setBufferSize(int bufferSize)
public void setAddress(String multicastAddress)
setAddress
in interface ClientTransport
multicastAddress
- the multicat addresspublic void setPort(int port)
setPort
in interface ClientTransport
port
- the transport portpublic void open() throws IOException
open
in interface Transport
IOException
- - if an I/O error occurs.public void close() throws IOException
close
in interface Transport
IOException
- - if an I/O error occurs.public boolean isOpen()
Transport
isOpen
in interface Transport
Transport.isOpen()
public void write(byte[] message) throws IOException
Transport
write
in interface Transport
message
- actual message
IOException
- if unable to writeTransport.write(byte[])
public int write(byte[] message, int offset, int length) throws IOException
Transport
write
in interface Transport
message
- actual messageoffset
- the offset in bufferlength
- the num of bytes to write
IOException
- if unable to writepublic int read(byte[] buffer) throws IOException
Transport
read
in interface Transport
buffer
- holder for read bytes
IOException
- if unable to readTransport.read(byte[])
public int read(byte[] buffer, int offset, int length) throws IOException
Transport
read
in interface Transport
buffer
- holder for read bytesoffset
- in bufferlength
- maximum bytes to be read
IOException
- if unable to readTransport.read(byte[], int, int)
public String getAddress()
Transport
getAddress
in interface Transport
Transport.getAddress()
public int getPort()
Transport
getPort
in interface Transport
Transport.getPort()
public int write(ByteBuffer buffer) throws IOException
write
in interface ClientTransport
write
in interface Transport
IOException
public int write(ByteBuffer buffer, int offset, int length) throws IOException
write
in interface ClientTransport
write
in interface Transport
IOException
public int read(ByteBuffer buffer, int offset, int length) throws IOException
read
in interface ClientTransport
read
in interface Transport
IOException
public int read(ByteBuffer buffer) throws IOException
read
in interface ClientTransport
read
in interface Transport
IOException
public void waitUntilReadyToWrite() throws IOException
waitUntilReadyToWrite
in interface Transport
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |