implement hooks into i2p streaming lib
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
package com.muwire.core.connection
|
||||
|
||||
import net.i2p.client.streaming.I2PServerSocket
|
||||
import net.i2p.client.streaming.I2PSocketManager
|
||||
|
||||
class I2PAcceptor {
|
||||
|
||||
final I2PSocketManager socketManager
|
||||
final I2PServerSocket serverSocket
|
||||
|
||||
I2PAcceptor() {}
|
||||
|
||||
I2PAcceptor(I2PSocketManager socketManager) {
|
||||
this.socketManager = socketManager
|
||||
this.serverSocket = socketManager.getServerSocket()
|
||||
}
|
||||
|
||||
Endpoint accept() {
|
||||
// TODO implement
|
||||
null
|
||||
def socket = serverSocket.accept()
|
||||
new Endpoint(socket.getPeerDestination(), socket.getInputStream(), socket.getOutputStream())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class I2PConnector {
|
||||
}
|
||||
|
||||
Endpoint connect(Destination dest) {
|
||||
//TODO implement
|
||||
null
|
||||
def socket = socketManager.connect(dest)
|
||||
new Endpoint(dest, socket.getInputStream(), socket.getOutputStream())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user