-
Notifications
You must be signed in to change notification settings - Fork 261
socket reader support split message by line #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
reader/rest_reader_models.go
Outdated
Default: "false", | ||
Advance: true, | ||
Description: "是否按'\\n'分隔内容(socket_split_by_line)", | ||
ToolTip: "开启后,对socket内容按'\\n'进行分隔", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否按行分隔内容(socket_split_by_line)
开启后,对socket内容按行进行分隔
reader/socket/socket.go
Outdated
|
||
if psr.IsSplitByLine{ | ||
vals := strings.Split(val, "\n") | ||
for _, value := range vals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trime一下,空行就continue
reader/socket/socket.go
Outdated
} | ||
}else{ | ||
psr.readChan <- socketInfo{address: address, data: val} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这个逻辑块漏写了个地方,tcp的也是 streamSocketReader
reader/socket/socket.go
Outdated
if ssr.IsSplitByLine { | ||
vals := strings.Split(val, "\n") | ||
for _, value := range vals { | ||
if value = strings.Trim(value, " "); value != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrimSpace
6fbc640
to
ac9e87f
Compare
LGTM |
No description provided.