introduce Endpoint concept for i2p endpoints
This commit is contained in:
@@ -7,18 +7,13 @@ import net.i2p.data.Destination
|
|||||||
abstract class Connection {
|
abstract class Connection {
|
||||||
|
|
||||||
final EventBus eventBus
|
final EventBus eventBus
|
||||||
final InputStream inputStream
|
final Endpoint endpoint
|
||||||
final OutputStream outputStream
|
|
||||||
final Destination remoteSide
|
|
||||||
final boolean incoming
|
final boolean incoming
|
||||||
|
|
||||||
Connection(EventBus eventBus, InputStream inputStream, OutputStream outputStream,
|
Connection(EventBus eventBus, Endpoint endpoint, boolean incoming) {
|
||||||
Destination remoteSide, boolean incoming) {
|
|
||||||
this.eventBus = eventBus
|
this.eventBus = eventBus
|
||||||
this.inputStream = inputStream
|
|
||||||
this.outputStream = outputStream
|
|
||||||
this.remoteSide = remoteSide
|
|
||||||
this.incoming = incoming
|
this.incoming = incoming
|
||||||
|
this.endpoint = endpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -0,0 +1,15 @@
|
|||||||
|
package com.muwire.core.connection
|
||||||
|
|
||||||
|
import net.i2p.data.Destination
|
||||||
|
|
||||||
|
class Endpoint {
|
||||||
|
final Destination destination
|
||||||
|
final InputStream inputStream
|
||||||
|
final OutputStream outputStream
|
||||||
|
|
||||||
|
Endpoint(Destination destination, InputStream inputStream, OutputStream outputStream) {
|
||||||
|
this.destination = destination
|
||||||
|
this.inputStream = inputStream
|
||||||
|
this.outputStream = outputStream
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
package com.muwire.core.connection
|
||||||
|
|
||||||
|
import net.i2p.data.Destination
|
||||||
|
|
||||||
|
class I2PConnector {
|
||||||
|
|
||||||
|
Endpoint connect(Destination dest) {
|
||||||
|
//TODO implement
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user