net-coroutines
Module Contents
alltypes
Module Contents
interface
CoroutineByteChannel
:
ReadableCoroutineByteChannel
,
WritableCoroutineByteChannel
sealed
class
CoroutineChannelGroup
Module Contents
abstract
suspend
fun
awaitTermination
(
)
:
Unit
abstract
val
isShutdown
:
Boolean
abstract
val
isTerminated
:
Boolean
fun
open
(
nSelectors
:
Int
=
Runtime.getRuntime().availableProcessors()
,
executor
:
Executor
=
Executors.newFixedThreadPool(nSelectors, CoroutineSelector.DEFAULT_THREAD_FACTORY)
,
loggerProvider
:
LoggerProvider
=
LoggerProvider.nullProvider()
,
selectTimeout
:
Long
=
1000
,
idleTimeout
:
Long
=
10000
)
:
CoroutineChannelGroup
abstract
fun
shutdown
(
)
:
Unit
abstract
fun
shutdownNow
(
)
:
Unit
class
CoroutineDatagramChannel
:
CoroutineByteChannel
,
ScatteringCoroutineByteChannel
,
GatheringCoroutineByteChannel
,
CoroutineNetworkChannel
Module Contents
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineDatagramChannel
fun
close
(
)
:
Unit
fun
connect
(
remote
:
SocketAddress
)
:
CoroutineDatagramChannel
fun
disconnect
(
)
:
CoroutineDatagramChannel
val
isConnected
:
Boolean
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineDatagramChannel
suspend
fun
receive
(
dst
:
ByteBuffer
)
:
SocketAddress
val
remoteAddress
:
SocketAddress
suspend
fun
send
(
src
:
ByteBuffer
,
target
:
SocketAddress
)
:
Int
fun
tryReceive
(
dst
:
ByteBuffer
)
:
SocketAddress
?
fun
trySend
(
src
:
ByteBuffer
,
target
:
SocketAddress
)
:
Int
interface
CoroutineNetworkChannel
:
NetworkChannel
Module Contents
abstract
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineNetworkChannel
abstract
fun
close
(
)
:
Unit
open
fun
getAdvertisableAddress
(
)
:
InetAddress
?
abstract
fun
getLocalAddress
(
)
:
SocketAddress
?
abstract
fun
<
T
:
Any
>
getOption
(
name
:
SocketOption
<
T
>
)
:
T
?
abstract
fun
isOpen
(
)
:
Boolean
abstract
val
localPort
:
Int
abstract
fun
<
T
:
Any
>
setOption
(
name
:
SocketOption
<
T
>
,
value
:
T
?
)
:
NetworkChannel
abstract
fun
supportedOptions
(
)
:
Set
<
SocketOption
<
*
>
>
sealed
class
CoroutineSelector
Module Contents
abstract
suspend
fun
cancelSelections
(
channel
:
SelectableChannel
,
cause
:
Throwable
?
=
null
)
:
Boolean
abstract
fun
close
(
)
:
Unit
abstract
suspend
fun
closeNow
(
)
:
Unit
abstract
fun
isOpen
(
)
:
Boolean
fun
open
(
executor
:
Executor
=
Executors.newSingleThreadExecutor(DEFAULT_THREAD_FACTORY)
,
loggerProvider
:
LoggerProvider
=
LoggerProvider.nullProvider()
,
selectTimeout
:
Long
=
1000
,
idleTimeout
:
Long
=
10000
)
:
CoroutineSelector
abstract
suspend
fun
select
(
channel
:
SelectableChannel
,
ops
:
Int
)
:
Unit
abstract
fun
wakeup
(
)
:
Unit
class
CoroutineServerSocketChannel
:
CoroutineNetworkChannel
Module Contents
suspend
fun
accept
(
)
:
CoroutineSocketChannel
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineServerSocketChannel
fun
bind
(
local
:
SocketAddress
?
,
backlog
:
Int
)
:
CoroutineServerSocketChannel
fun
close
(
)
:
Unit
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineServerSocketChannel
class
CoroutineSocketChannel
:
CoroutineByteChannel
,
ScatteringCoroutineByteChannel
,
GatheringCoroutineByteChannel
,
CoroutineNetworkChannel
Module Contents
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineSocketChannel
fun
close
(
)
:
Unit
suspend
fun
connect
(
remote
:
SocketAddress
)
:
CoroutineSocketChannel
val
isConnected
:
Boolean
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineSocketChannel
val
remoteAddress
:
SocketAddress
fun
shutdownInput
(
)
:
CoroutineSocketChannel
fun
shutdownOutput
(
)
:
CoroutineSocketChannel
interface
GatheringCoroutineByteChannel
:
WritableCoroutineByteChannel
Module Contents
abstract
fun
tryWrite
(
srcs
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
srcs.size
)
:
Long
abstract
suspend
fun
write
(
srcs
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
srcs.size
)
:
Long
interface
ReadableCoroutineByteChannel
Module Contents
abstract
suspend
fun
read
(
dst
:
ByteBuffer
)
:
Int
abstract
fun
tryRead
(
dst
:
ByteBuffer
)
:
Int
interface
ScatteringCoroutineByteChannel
:
ReadableCoroutineByteChannel
Module Contents
abstract
suspend
fun
read
(
dsts
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
dsts.size
)
:
Long
abstract
fun
tryRead
(
dsts
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
dsts.size
)
:
Long
interface
WritableCoroutineByteChannel
Module Contents
abstract
fun
tryWrite
(
src
:
ByteBuffer
)
:
Int
abstract
suspend
fun
write
(
src
:
ByteBuffer
)
:
Int
package
org.apache.tuweni.net.coroutines
Module Contents
val
CommonCoroutineGroup
:
CoroutineChannelGroup
interface
CoroutineByteChannel
:
ReadableCoroutineByteChannel
,
WritableCoroutineByteChannel
sealed
class
CoroutineChannelGroup
Module Contents
abstract
suspend
fun
awaitTermination
(
)
:
Unit
abstract
val
isShutdown
:
Boolean
abstract
val
isTerminated
:
Boolean
fun
open
(
nSelectors
:
Int
=
Runtime.getRuntime().availableProcessors()
,
executor
:
Executor
=
Executors.newFixedThreadPool(nSelectors, CoroutineSelector.DEFAULT_THREAD_FACTORY)
,
loggerProvider
:
LoggerProvider
=
LoggerProvider.nullProvider()
,
selectTimeout
:
Long
=
1000
,
idleTimeout
:
Long
=
10000
)
:
CoroutineChannelGroup
abstract
fun
shutdown
(
)
:
Unit
abstract
fun
shutdownNow
(
)
:
Unit
class
CoroutineDatagramChannel
:
CoroutineByteChannel
,
ScatteringCoroutineByteChannel
,
GatheringCoroutineByteChannel
,
CoroutineNetworkChannel
Module Contents
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineDatagramChannel
fun
close
(
)
:
Unit
fun
connect
(
remote
:
SocketAddress
)
:
CoroutineDatagramChannel
fun
disconnect
(
)
:
CoroutineDatagramChannel
val
isConnected
:
Boolean
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineDatagramChannel
suspend
fun
receive
(
dst
:
ByteBuffer
)
:
SocketAddress
val
remoteAddress
:
SocketAddress
suspend
fun
send
(
src
:
ByteBuffer
,
target
:
SocketAddress
)
:
Int
fun
tryReceive
(
dst
:
ByteBuffer
)
:
SocketAddress
?
fun
trySend
(
src
:
ByteBuffer
,
target
:
SocketAddress
)
:
Int
interface
CoroutineNetworkChannel
:
NetworkChannel
Module Contents
abstract
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineNetworkChannel
abstract
fun
close
(
)
:
Unit
open
fun
getAdvertisableAddress
(
)
:
InetAddress
?
abstract
fun
getLocalAddress
(
)
:
SocketAddress
?
abstract
fun
<
T
:
Any
>
getOption
(
name
:
SocketOption
<
T
>
)
:
T
?
abstract
fun
isOpen
(
)
:
Boolean
abstract
val
localPort
:
Int
abstract
fun
<
T
:
Any
>
setOption
(
name
:
SocketOption
<
T
>
,
value
:
T
?
)
:
NetworkChannel
abstract
fun
supportedOptions
(
)
:
Set
<
SocketOption
<
*
>
>
sealed
class
CoroutineSelector
Module Contents
abstract
suspend
fun
cancelSelections
(
channel
:
SelectableChannel
,
cause
:
Throwable
?
=
null
)
:
Boolean
abstract
fun
close
(
)
:
Unit
abstract
suspend
fun
closeNow
(
)
:
Unit
abstract
fun
isOpen
(
)
:
Boolean
fun
open
(
executor
:
Executor
=
Executors.newSingleThreadExecutor(DEFAULT_THREAD_FACTORY)
,
loggerProvider
:
LoggerProvider
=
LoggerProvider.nullProvider()
,
selectTimeout
:
Long
=
1000
,
idleTimeout
:
Long
=
10000
)
:
CoroutineSelector
abstract
suspend
fun
select
(
channel
:
SelectableChannel
,
ops
:
Int
)
:
Unit
abstract
fun
wakeup
(
)
:
Unit
class
CoroutineServerSocketChannel
:
CoroutineNetworkChannel
Module Contents
suspend
fun
accept
(
)
:
CoroutineSocketChannel
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineServerSocketChannel
fun
bind
(
local
:
SocketAddress
?
,
backlog
:
Int
)
:
CoroutineServerSocketChannel
fun
close
(
)
:
Unit
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineServerSocketChannel
class
CoroutineSocketChannel
:
CoroutineByteChannel
,
ScatteringCoroutineByteChannel
,
GatheringCoroutineByteChannel
,
CoroutineNetworkChannel
Module Contents
fun
bind
(
local
:
SocketAddress
?
)
:
CoroutineSocketChannel
fun
close
(
)
:
Unit
suspend
fun
connect
(
remote
:
SocketAddress
)
:
CoroutineSocketChannel
val
isConnected
:
Boolean
fun
open
(
group
:
CoroutineChannelGroup
=
CommonCoroutineGroup
)
:
CoroutineSocketChannel
val
remoteAddress
:
SocketAddress
fun
shutdownInput
(
)
:
CoroutineSocketChannel
fun
shutdownOutput
(
)
:
CoroutineSocketChannel
interface
GatheringCoroutineByteChannel
:
WritableCoroutineByteChannel
Module Contents
abstract
fun
tryWrite
(
srcs
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
srcs.size
)
:
Long
abstract
suspend
fun
write
(
srcs
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
srcs.size
)
:
Long
interface
ReadableCoroutineByteChannel
Module Contents
abstract
suspend
fun
read
(
dst
:
ByteBuffer
)
:
Int
abstract
fun
tryRead
(
dst
:
ByteBuffer
)
:
Int
interface
ScatteringCoroutineByteChannel
:
ReadableCoroutineByteChannel
Module Contents
abstract
suspend
fun
read
(
dsts
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
dsts.size
)
:
Long
abstract
fun
tryRead
(
dsts
:
Array
<
ByteBuffer
>
,
offset
:
Int
=
0
,
length
:
Int
=
dsts.size
)
:
Long
interface
WritableCoroutineByteChannel
Module Contents
abstract
fun
tryWrite
(
src
:
ByteBuffer
)
:
Int
abstract
suspend
fun
write
(
src
:
ByteBuffer
)
:
Int