Skip to content

feat: expose socket connected state#32

Merged
Piasy merged 2 commits intomainfrom
feat/expose-socket-connected-state
Apr 14, 2026
Merged

feat: expose socket connected state#32
Piasy merged 2 commits intomainfrom
feat/expose-socket-connected-state

Conversation

@Piasy
Copy link
Copy Markdown
Member

@Piasy Piasy commented Apr 13, 2026

Summary

  • expose Socket.connected as a public read-only property (private set)
  • keep all internal state transitions unchanged
  • add a shared connection-state test that validates: before open -> connected -> disconnected
  • add a JVM-specific ConnectionTestJvm so the shared connection tests also run on jvmTest

Testing

  • run npm ci in kmp-socketio/src/jvmTest/resources
  • run ./gradlew :kmp-socketio:linuxX64Test --tests "*ConnectionTestLinux.connectAndEcho*" --tests "*ConnectionTestLinux.shouldExposeConnectionState*"
  • run ./gradlew :kmp-socketio:jvmTest --tests "*ConnectionTestJvm.connectAndEcho*" --tests "*ConnectionTestJvm.shouldExposeConnectionState*"

Closes #24

@github-actions
Copy link
Copy Markdown

Overall Project 94.22%
Files changed 100%

File Coverage
Socket.kt 94.41%

@Piasy Piasy force-pushed the feat/expose-socket-connected-state branch from 5d13403 to dfca894 Compare April 13, 2026 23:45
@github-actions
Copy link
Copy Markdown

Overall Project 94.05%
Files changed 100%

File Coverage
Socket.kt 94.41%

@Piasy Piasy merged commit 1d93b33 into main Apr 14, 2026
4 checks passed
@Piasy Piasy deleted the feat/expose-socket-connected-state branch April 14, 2026 00:08
github-actions Bot pushed a commit that referenced this pull request Apr 14, 2026
* feat: expose socket connected state

* test: stabilize jvm connection state coverage 1d93b33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there a public way to check socket connection state?

1 participant