mirror of https://github.com/zlatinb/muwire
implement hooks into i2p streaming lib
parent
92e5cc87ef
commit
90a1fa6a0d
|
@ -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())
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue