Skip to content

Commit bb51e84

Browse files
TobbemanTobbeman
Tobbeman
andauthored
Add return error on write actions (#104)
This error can be used to detect if the connection was broken, for example if the server goes down between client sending data Co-authored-by: Tobias Laving <[email protected]>
1 parent a527e68 commit bb51e84

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

netconf/transport.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ func (t *transportBasicIO) Send(data []byte) error {
7474
}
7575
dataInfo = append(dataInfo, data...)
7676
dataInfo = append(dataInfo, seperator...)
77-
t.Write(dataInfo)
77+
_, err := t.Write(dataInfo)
7878

79-
return nil // TODO: Implement error handling!
79+
return err
8080
}
8181

8282
func (t *transportBasicIO) Receive() ([]byte, error) {

0 commit comments

Comments
 (0)