Package net.i2p.sam
Class SAMv3RawSession
java.lang.Object
net.i2p.sam.SAMMessageSession
net.i2p.sam.SAMRawSession
net.i2p.sam.SAMv3RawSession
- All Implemented Interfaces:
Closeable,AutoCloseable,SAMMessageSess,SAMRawReceiver,Session
class SAMv3RawSession extends SAMRawSession implements Session, SAMRawReceiver
- Author:
- MKVore
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SAMv3RawSession(String nick, Properties props, SAMv3Handler handler, I2PSession isess, int listenProtocol, int listenPort, SAMv3DatagramServer dgServer)Build a Raw Session on an existing i2p session registered with the given nickname Caller MUST call start().SAMv3RawSession(String nick, SAMv3DatagramServer dgServer)Build a Raw Datagram Session according to information registered with the given nickname Caller MUST call start(). -
Method Summary
Modifier and Type Method Description StringgetNick()(package private) static SocketAddressgetSocketAddress(Properties props, SAMv3Handler handler)voidreceiveRawBytes(byte[] data, int proto, int fromPort, int toPort)Send a byte array to a SAM client, without informations regarding the sender.voidstopRawReceiving()Stop receiving data.Methods inherited from class net.i2p.sam.SAMRawSession
messageReceived, sendBytes, sendBytes, shutDownMethods inherited from class net.i2p.sam.SAMMessageSession
close, getDestination, getI2PSession, getListenPort, getListenProtocol, sendBytesThroughMessageSession, sendBytesThroughMessageSession, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.i2p.sam.SAMMessageSess
close, getDestination, getListenPort, getListenProtocol, sendBytes, sendBytes, start
-
Constructor Details
-
SAMv3RawSession
public SAMv3RawSession(String nick, SAMv3DatagramServer dgServer) throws IOException, DataFormatException, I2PSessionExceptionBuild a Raw Datagram Session according to information registered with the given nickname Caller MUST call start().- Parameters:
nick- nickname of the session- Throws:
IOExceptionDataFormatExceptionI2PSessionException
-
SAMv3RawSession
public SAMv3RawSession(String nick, Properties props, SAMv3Handler handler, I2PSession isess, int listenProtocol, int listenPort, SAMv3DatagramServer dgServer) throws IOException, DataFormatException, I2PSessionExceptionBuild a Raw Session on an existing i2p session registered with the given nickname Caller MUST call start().- Parameters:
nick- nickname of the session- Throws:
IOExceptionDataFormatExceptionI2PSessionException- Since:
- 0.9.25
-
-
Method Details
-
getNick
-
getSocketAddress
- Returns:
- null if PORT not set
- Since:
- 0.9.25 moved from constructor
-
receiveRawBytes
Description copied from interface:SAMRawReceiverSend a byte array to a SAM client, without informations regarding the sender.- Specified by:
receiveRawBytesin interfaceSAMRawReceiver- Parameters:
data- Byte array to be receivedproto- I2CP protocolfromPort- I2CP from porttoPort- I2CP to port- Throws:
IOException
-
stopRawReceiving
public void stopRawReceiving()Description copied from interface:SAMRawReceiverStop receiving data.- Specified by:
stopRawReceivingin interfaceSAMRawReceiver
-