Skip to content

Commit 1f17de7

Browse files
committed
Update README
1 parent 9d27d8b commit 1f17de7

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

README.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -280,32 +280,6 @@ let icmpPacket = createICMPPacket() // Your ICMP packet data
280280
try await socket.write(icmpPacket)
281281
```
282282

283-
## Error Handling
284-
285-
Socket operations throw `SocketError` which conforms to Swift's `Error` protocol:
286-
287-
```swift
288-
import Socket
289-
290-
do {
291-
let socket = try await Socket(IPv4Protocol.tcp)
292-
try await socket.connect(to: address)
293-
} catch let error as SocketError {
294-
switch error.code {
295-
case .connectionRefused:
296-
print("Connection refused by server")
297-
case .networkUnreachable:
298-
print("Network is unreachable")
299-
case .timeout:
300-
print("Operation timed out")
301-
default:
302-
print("Socket error: \(error)")
303-
}
304-
} catch {
305-
print("Unexpected error: \(error)")
306-
}
307-
```
308-
309283
## Requirements
310284

311285
- Swift 5.7+
@@ -317,4 +291,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
317291

318292
## License
319293

320-
This project is licensed under the MIT License - see the LICENSE file for details.
294+
This project is licensed under the MIT License - see the LICENSE file for details.

0 commit comments

Comments
 (0)