Refactor onCloseCallback to onClose and update related usages across the codebase (#62)
This commit is contained in:
parent
0f3adfdd14
commit
1c5e54936d
3 changed files with 13 additions and 24 deletions
|
|
@ -30,7 +30,6 @@ public class ServerOptions(
|
|||
*
|
||||
* @param serverInfo Information about this server implementation (name, version).
|
||||
* @param options Configuration options for the server.
|
||||
* @param onCloseCallback A callback invoked when the server connection closes.
|
||||
*/
|
||||
public open class Server(
|
||||
private val serverInfo: Implementation,
|
||||
|
|
@ -127,7 +126,6 @@ public open class Server(
|
|||
|
||||
/**
|
||||
* Called when the server connection is closing.
|
||||
* Invokes [onCloseCallback] if set.
|
||||
*/
|
||||
override fun onClose() {
|
||||
logger.info { "Server connection closing" }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import io.modelcontextprotocol.kotlin.sdk.JSONRPCMessage
|
||||
import io.modelcontextprotocol.kotlin.sdk.shared.AbstractTransport
|
||||
import io.modelcontextprotocol.kotlin.sdk.shared.Transport
|
||||
|
||||
/**
|
||||
* In-memory transport for creating clients and servers that talk to each other within the same process.
|
||||
|
|
|
|||
|
|
@ -96,11 +96,9 @@ class InMemoryTransportTest {
|
|||
clientTransport.close()
|
||||
|
||||
assertThrows<IllegalStateException> {
|
||||
runBlocking {
|
||||
clientTransport.send(
|
||||
InitializedNotification().toJSON()
|
||||
)
|
||||
}
|
||||
clientTransport.send(
|
||||
InitializedNotification().toJSON()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue