Package ai.preferred.venom.socks
Class SocksIOSession
- java.lang.Object
-
- ai.preferred.venom.socks.SocksIOSession
-
- All Implemented Interfaces:
org.apache.http.nio.reactor.IOSession
public class SocksIOSession extends Object implements org.apache.http.nio.reactor.IOSession
The class establishes Socks4a connection and delegates the interface calls to a decoratedIOSession
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SESSION_KEY
SOCKS session key.
-
Constructor Summary
Constructors Constructor Description SocksIOSession(org.apache.http.nio.reactor.IOSession innerSession)
DecoratesIOSession
, sets default user ID for a SOCKS proxy.SocksIOSession(org.apache.http.nio.reactor.IOSession innerSession, String userId)
DecoratesIOSession
, allows to specify user ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteChannel
channel()
void
clearEvent(int op)
void
close()
Object
getAttribute(String name)
int
getEventMask()
SocketAddress
getLocalAddress()
SocketAddress
getRemoteAddress()
int
getSocketTimeout()
int
getStatus()
boolean
hasBufferedInput()
boolean
hasBufferedOutput()
boolean
isClosed()
Object
removeAttribute(String name)
void
setAttribute(String name, Object obj)
void
setBufferStatus(org.apache.http.nio.reactor.SessionBufferStatus status)
void
setEvent(int op)
void
setEventMask(int ops)
void
setSocketTimeout(int timeout)
void
shutdown()
-
-
-
Field Detail
-
SESSION_KEY
public static final String SESSION_KEY
SOCKS session key.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SocksIOSession
public SocksIOSession(org.apache.http.nio.reactor.IOSession innerSession)
DecoratesIOSession
, sets default user ID for a SOCKS proxy.- Parameters:
innerSession
- decorated session
-
SocksIOSession
public SocksIOSession(org.apache.http.nio.reactor.IOSession innerSession, String userId)
DecoratesIOSession
, allows to specify user ID.- Parameters:
innerSession
- decorated sessionuserId
- user id as in SOCKS4a specification
-
-
Method Detail
-
channel
public ByteChannel channel()
- Specified by:
channel
in interfaceorg.apache.http.nio.reactor.IOSession
-
getRemoteAddress
public SocketAddress getRemoteAddress()
- Specified by:
getRemoteAddress
in interfaceorg.apache.http.nio.reactor.IOSession
-
getLocalAddress
public SocketAddress getLocalAddress()
- Specified by:
getLocalAddress
in interfaceorg.apache.http.nio.reactor.IOSession
-
getEventMask
public int getEventMask()
- Specified by:
getEventMask
in interfaceorg.apache.http.nio.reactor.IOSession
-
setEventMask
public void setEventMask(int ops)
- Specified by:
setEventMask
in interfaceorg.apache.http.nio.reactor.IOSession
-
setEvent
public void setEvent(int op)
- Specified by:
setEvent
in interfaceorg.apache.http.nio.reactor.IOSession
-
clearEvent
public void clearEvent(int op)
- Specified by:
clearEvent
in interfaceorg.apache.http.nio.reactor.IOSession
-
close
public void close()
- Specified by:
close
in interfaceorg.apache.http.nio.reactor.IOSession
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceorg.apache.http.nio.reactor.IOSession
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceorg.apache.http.nio.reactor.IOSession
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceorg.apache.http.nio.reactor.IOSession
-
getSocketTimeout
public int getSocketTimeout()
- Specified by:
getSocketTimeout
in interfaceorg.apache.http.nio.reactor.IOSession
-
setSocketTimeout
public void setSocketTimeout(int timeout)
- Specified by:
setSocketTimeout
in interfaceorg.apache.http.nio.reactor.IOSession
-
setBufferStatus
public void setBufferStatus(org.apache.http.nio.reactor.SessionBufferStatus status)
- Specified by:
setBufferStatus
in interfaceorg.apache.http.nio.reactor.IOSession
-
hasBufferedInput
public boolean hasBufferedInput()
- Specified by:
hasBufferedInput
in interfaceorg.apache.http.nio.reactor.IOSession
-
hasBufferedOutput
public boolean hasBufferedOutput()
- Specified by:
hasBufferedOutput
in interfaceorg.apache.http.nio.reactor.IOSession
-
setAttribute
public void setAttribute(String name, Object obj)
- Specified by:
setAttribute
in interfaceorg.apache.http.nio.reactor.IOSession
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttribute
in interfaceorg.apache.http.nio.reactor.IOSession
-
-