public class CommandMessage extends Object implements ReadableMessage, WritableMessage
RequestCommandMessage
represents a SOCKS5 command message.Modifier and Type | Field and Description |
---|---|
protected static int |
CMD_BIND
Value of BIND command.
|
protected static int |
CMD_CONNECT
Value of CONNECTE command.
|
protected static int |
CMD_UDP_ASSOCIATE
Value of UDP ASSOCIATE command.
|
Constructor and Description |
---|
CommandMessage() |
Modifier and Type | Method and Description |
---|---|
int |
getAddressType() |
byte[] |
getBytes()
Returns the byte array of the message.
|
SocksCommand |
getCommand() |
String |
getHost() |
InetAddress |
getInetAddress() |
int |
getLength()
Returns the length of message.
|
int |
getPort() |
int |
getReserved() |
SocketAddress |
getSocketAddress() |
SocksException |
getSocksException() |
int |
getVersion()
Returns version.
|
boolean |
hasSocksException() |
void |
read(InputStream inputStream)
Read message from a input stream.
|
void |
setAddressType(int addressType) |
void |
setCommand(SocksCommand command) |
void |
setHost(String host) |
void |
setInetAddress(InetAddress inetAddress) |
void |
setPort(int port) |
void |
setReserved(int reserved) |
void |
setSocksException(SocksException socksException) |
void |
setVersion(int version)
Sets version.
|
protected static final int CMD_CONNECT
protected static final int CMD_BIND
protected static final int CMD_UDP_ASSOCIATE
public int getLength()
Message
public byte[] getBytes()
WritableMessage
getBytes
in interface WritableMessage
public void read(InputStream inputStream) throws SocksException, IOException
ReadableMessage
read
in interface ReadableMessage
inputStream
- Input stream.SocksException
- If a SOCKS protocol error occurred.IOException
- If an I/O error occurred.public int getVersion()
public void setVersion(int version)
version
- Version.public boolean hasSocksException()
public InetAddress getInetAddress()
public void setInetAddress(InetAddress inetAddress)
public int getPort()
public void setPort(int port)
public String getHost()
public void setHost(String host)
public SocksCommand getCommand()
public void setCommand(SocksCommand command)
public int getReserved()
public void setReserved(int reserved)
public int getAddressType()
public void setAddressType(int addressType)
public SocketAddress getSocketAddress()
public SocksException getSocksException()
public void setSocksException(SocksException socksException)
Copyright © 2015. All rights reserved.