Skip to content

Commit c0f4eea

Browse files
authored
Update README.md
1 parent 2192631 commit c0f4eea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ server.enableExec(withDelegate: MyExecDelegate())
205205
server.enableSFTP(withDelegate: MySFTPDelegate())
206206
```
207207

208+
If you're running the SSHServer from `main.swift` or an `@main` annotated type, make sure that Swift doesn't exit or `deinit` the server.
209+
A simple solution that is applicable most of the time is to use the server's `closeFuture`.
210+
211+
```swift
212+
try await server.closeFuture.get()
213+
```
214+
208215
### Exec Server
209216

210217
When creating a command execution delegate, simply implement the `ExecDelegate` protocol and the following functions:

0 commit comments

Comments
 (0)