net.i2p.sam
Class SAMv3Handler
java.lang.Object
net.i2p.sam.SAMHandler
net.i2p.sam.SAMv1Handler
net.i2p.sam.SAMv3Handler
- All Implemented Interfaces:
- Runnable, SAMDatagramReceiver, SAMRawReceiver, SAMStreamReceiver
public class SAMv3Handler
- extends SAMv1Handler
Class able to handle a SAM version 3 client connection.
- Author:
- mkvore
Methods inherited from class net.i2p.sam.SAMv1Handler |
execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execStreamClose, execStreamSend, newSAMStreamSession, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer |
Methods inherited from class net.i2p.sam.SAMHandler |
closeClientSocket, getClientSocket, getWriteLock, run, setBridge, shouldStop, startHandling, stopHandling, toString, writeBytes, writeBytes, writeString, writeString |
rawSession
protected SAMv3RawSession rawSession
datagramSession
protected SAMv3DatagramSession datagramSession
streamSession
protected SAMv3StreamSession streamSession
session
protected SAMv3Handler.Session session
sSessionsHash
public static SAMv3Handler.SessionsDB sSessionsHash
stolenSocket
boolean stolenSocket
streamForwardingSocket
boolean streamForwardingSocket
SAMv3Handler
public SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor)
throws SAMException,
IOException
- Create a new SAM version 3 handler. This constructor expects
that the SAM HELLO message has been still answered (and
stripped) from the socket input stream.
- Parameters:
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to manage
- Throws:
SAMException
IOException
SAMv3Handler
public SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps)
throws SAMException,
IOException
- Create a new SAM version 3 handler. This constructor expects
that the SAM HELLO message has been still answered (and
stripped) from the socket input stream.
- Parameters:
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to managei2cpProps
- properties to configure the I2CP connection (host, port, etc)
- Throws:
SAMException
IOException
getRawSession
protected SAMRawSession getRawSession()
- Overrides:
getRawSession
in class SAMv1Handler
getDatagramSession
protected SAMDatagramSession getDatagramSession()
- Overrides:
getDatagramSession
in class SAMv1Handler
getStreamSession
protected SAMStreamSession getStreamSession()
- Overrides:
getStreamSession
in class SAMv1Handler
verifVersion
public boolean verifVersion()
- Overrides:
verifVersion
in class SAMv1Handler
getClientIP
public String getClientIP()
stealSocket
public void stealSocket()
handle
public void handle()
- Description copied from class:
SAMHandler
- Actually handle the SAM protocol.
- Overrides:
handle
in class SAMv1Handler
die
protected void die()
execSessionMessage
protected boolean execSessionMessage(String opcode,
Properties props)
- Overrides:
execSessionMessage
in class SAMv1Handler
newSAMStreamSession
SAMv3StreamSession newSAMStreamSession(String login)
throws IOException,
DataFormatException,
SAMException
- Throws:
IOException
DataFormatException
SAMException
newSAMRawSession
SAMv3RawSession newSAMRawSession(String login)
throws IOException,
DataFormatException,
SAMException,
I2PSessionException
- Throws:
IOException
DataFormatException
SAMException
I2PSessionException
newSAMDatagramSession
SAMv3DatagramSession newSAMDatagramSession(String login)
throws IOException,
DataFormatException,
SAMException,
I2PSessionException
- Throws:
IOException
DataFormatException
SAMException
I2PSessionException
execStreamMessage
protected boolean execStreamMessage(String opcode,
Properties props)
- Overrides:
execStreamMessage
in class SAMv1Handler
execStreamConnect
protected boolean execStreamConnect(Properties props)
- Overrides:
execStreamConnect
in class SAMv1Handler
execStreamForwardIncoming
protected boolean execStreamForwardIncoming(Properties props)
execStreamAccept
protected boolean execStreamAccept(Properties props)
notifyStreamResult
public void notifyStreamResult(boolean verbose,
String result,
String message)
throws IOException
- Throws:
IOException
notifyStreamIncomingConnection
public void notifyStreamIncomingConnection(Destination d)
throws IOException
- Throws:
IOException
notifyStreamIncomingConnection
public static void notifyStreamIncomingConnection(SocketChannel client,
Destination d)
throws IOException
- Throws:
IOException