Commit a7857f14 authored by Him188's avatar Him188

Remove `inline` modifier

parent 147254ce
...@@ -30,7 +30,7 @@ actual class PlatformSocket : Closeable { ...@@ -30,7 +30,7 @@ actual class PlatformSocket : Closeable {
@PublishedApi @PublishedApi
internal lateinit var readChannel: BufferedInputStream 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) { withContext(Dispatchers.IO) {
writeChannel.write(packet, offset, length) writeChannel.write(packet, offset, length)
writeChannel.flush() writeChannel.flush()
...@@ -40,7 +40,7 @@ actual class PlatformSocket : Closeable { ...@@ -40,7 +40,7 @@ actual class PlatformSocket : Closeable {
/** /**
* @throws SendPacketInternalException * @throws SendPacketInternalException
*/ */
actual suspend inline fun send(packet: ByteReadPacket) { actual suspend fun send(packet: ByteReadPacket) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
try { try {
writeChannel.writePacket(packet) writeChannel.writePacket(packet)
...@@ -54,7 +54,7 @@ actual class PlatformSocket : Closeable { ...@@ -54,7 +54,7 @@ actual class PlatformSocket : Closeable {
/** /**
* @throws ReadPacketInternalException * @throws ReadPacketInternalException
*/ */
actual suspend inline fun read(): ByteReadPacket { actual suspend fun read(): ByteReadPacket {
return withContext(Dispatchers.IO) { return withContext(Dispatchers.IO) {
try { try {
readChannel.readPacketAtMost(Long.MAX_VALUE) readChannel.readPacketAtMost(Long.MAX_VALUE)
......
...@@ -15,17 +15,17 @@ expect class PlatformSocket() : Closeable { ...@@ -15,17 +15,17 @@ expect class PlatformSocket() : Closeable {
/** /**
* @throws SendPacketInternalException * @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 * @throws SendPacketInternalException
*/ */
suspend inline fun send(packet: ByteReadPacket) suspend fun send(packet: ByteReadPacket)
/** /**
* @throws ReadPacketInternalException * @throws ReadPacketInternalException
*/ */
suspend inline fun read(): ByteReadPacket suspend fun read(): ByteReadPacket
val isOpen: Boolean val isOpen: Boolean
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ actual class PlatformSocket : Closeable { ...@@ -34,7 +34,7 @@ actual class PlatformSocket : Closeable {
@PublishedApi @PublishedApi
internal lateinit var readChannel: BufferedInputStream 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) { withContext(Dispatchers.IO) {
writeChannel.write(packet, offset, length) writeChannel.write(packet, offset, length)
writeChannel.flush() writeChannel.flush()
...@@ -44,7 +44,7 @@ actual class PlatformSocket : Closeable { ...@@ -44,7 +44,7 @@ actual class PlatformSocket : Closeable {
/** /**
* @throws SendPacketInternalException * @throws SendPacketInternalException
*/ */
actual suspend inline fun send(packet: ByteReadPacket) { actual suspend fun send(packet: ByteReadPacket) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
try { try {
writeChannel.writePacket(packet) writeChannel.writePacket(packet)
...@@ -58,7 +58,7 @@ actual class PlatformSocket : Closeable { ...@@ -58,7 +58,7 @@ actual class PlatformSocket : Closeable {
/** /**
* @throws ReadPacketInternalException * @throws ReadPacketInternalException
*/ */
actual suspend inline fun read(): ByteReadPacket { actual suspend fun read(): ByteReadPacket {
return withContext(Dispatchers.IO) { return withContext(Dispatchers.IO) {
try { try {
readChannel.readPacketAtMost(Long.MAX_VALUE) readChannel.readPacketAtMost(Long.MAX_VALUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment