mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-01 03:50:18 +08:00
Remove inline
modifier
This commit is contained in:
parent
147254cecd
commit
a7857f147d
@ -30,7 +30,7 @@ actual class PlatformSocket : Closeable {
|
||||
@PublishedApi
|
||||
internal lateinit var readChannel: BufferedInputStream
|
||||
|
||||
actual suspend inline fun send(packet: ByteArray, offset: Int, length: Int) {
|
||||
actual suspend fun send(packet: ByteArray, offset: Int, length: Int) {
|
||||
withContext(Dispatchers.IO) {
|
||||
writeChannel.write(packet, offset, length)
|
||||
writeChannel.flush()
|
||||
@ -40,7 +40,7 @@ actual class PlatformSocket : Closeable {
|
||||
/**
|
||||
* @throws SendPacketInternalException
|
||||
*/
|
||||
actual suspend inline fun send(packet: ByteReadPacket) {
|
||||
actual suspend fun send(packet: ByteReadPacket) {
|
||||
withContext(Dispatchers.IO) {
|
||||
try {
|
||||
writeChannel.writePacket(packet)
|
||||
@ -54,7 +54,7 @@ actual class PlatformSocket : Closeable {
|
||||
/**
|
||||
* @throws ReadPacketInternalException
|
||||
*/
|
||||
actual suspend inline fun read(): ByteReadPacket {
|
||||
actual suspend fun read(): ByteReadPacket {
|
||||
return withContext(Dispatchers.IO) {
|
||||
try {
|
||||
readChannel.readPacketAtMost(Long.MAX_VALUE)
|
||||
|
@ -15,17 +15,17 @@ expect class PlatformSocket() : Closeable {
|
||||
/**
|
||||
* @throws SendPacketInternalException
|
||||
*/
|
||||
suspend inline fun send(packet: ByteArray, offset: Int = 0, length: Int = packet.size - offset)
|
||||
suspend fun send(packet: ByteArray, offset: Int = 0, length: Int = packet.size - offset)
|
||||
|
||||
/**
|
||||
* @throws SendPacketInternalException
|
||||
*/
|
||||
suspend inline fun send(packet: ByteReadPacket)
|
||||
suspend fun send(packet: ByteReadPacket)
|
||||
|
||||
/**
|
||||
* @throws ReadPacketInternalException
|
||||
*/
|
||||
suspend inline fun read(): ByteReadPacket
|
||||
suspend fun read(): ByteReadPacket
|
||||
|
||||
val isOpen: Boolean
|
||||
}
|
@ -34,7 +34,7 @@ actual class PlatformSocket : Closeable {
|
||||
@PublishedApi
|
||||
internal lateinit var readChannel: BufferedInputStream
|
||||
|
||||
actual suspend inline fun send(packet: ByteArray, offset: Int, length: Int) {
|
||||
actual suspend fun send(packet: ByteArray, offset: Int, length: Int) {
|
||||
withContext(Dispatchers.IO) {
|
||||
writeChannel.write(packet, offset, length)
|
||||
writeChannel.flush()
|
||||
@ -44,7 +44,7 @@ actual class PlatformSocket : Closeable {
|
||||
/**
|
||||
* @throws SendPacketInternalException
|
||||
*/
|
||||
actual suspend inline fun send(packet: ByteReadPacket) {
|
||||
actual suspend fun send(packet: ByteReadPacket) {
|
||||
withContext(Dispatchers.IO) {
|
||||
try {
|
||||
writeChannel.writePacket(packet)
|
||||
@ -58,7 +58,7 @@ actual class PlatformSocket : Closeable {
|
||||
/**
|
||||
* @throws ReadPacketInternalException
|
||||
*/
|
||||
actual suspend inline fun read(): ByteReadPacket {
|
||||
actual suspend fun read(): ByteReadPacket {
|
||||
return withContext(Dispatchers.IO) {
|
||||
try {
|
||||
readChannel.readPacketAtMost(Long.MAX_VALUE)
|
||||
|
Loading…
Reference in New Issue
Block a user