Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis authored Oct 1, 2023
1 parent 2192631 commit c0f4eea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ server.enableExec(withDelegate: MyExecDelegate())
server.enableSFTP(withDelegate: MySFTPDelegate())
```

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.
A simple solution that is applicable most of the time is to use the server's `closeFuture`.

```swift
try await server.closeFuture.get()
```

### Exec Server

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

0 comments on commit c0f4eea

Please sign in to comment.