Skip to content

Commit

Permalink
Add return error on write actions (#104)
Browse files Browse the repository at this point in the history
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 <lavingtobias@gmail.com>
  • Loading branch information
Tobbeman and Tobbeman committed Feb 26, 2021
1 parent a527e68 commit bb51e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
4 changes: 2 additions & 2 deletions netconf/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func (t *transportBasicIO) Send(data []byte) error {
}
dataInfo = append(dataInfo, data...)
dataInfo = append(dataInfo, seperator...)
t.Write(dataInfo)
_, err := t.Write(dataInfo)

return nil // TODO: Implement error handling!
return err
}

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

0 comments on commit bb51e84

Please sign in to comment.