-
Notifications
You must be signed in to change notification settings - Fork 2
[TS-716] Reworked serialforwarder to support multiple clients with si… #1
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
base: old-udp-wip
Are you sure you want to change the base?
Conversation
| sconn.SetInfoLogger(logger) | ||
| cconn.SetDebugLogger(log.New(os.Stdout, "DEBUG: ", logformat)) | ||
| cconn.SetInfoLogger(logger) | ||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly.
| cconn.SetWarningLogger(log.New(os.Stdout, "WARN: ", logformat)) | ||
| cconn.SetErrorLogger(log.New(os.Stdout, "ERROR: ", logformat)) | ||
|
|
||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly.
| dsp := moteconnection.NewPacketDispatcher(moteconnection.NewRawPacket(byte(i))) | ||
| dsp.RegisterReceiver(creceive) | ||
| cconn.AddDispatcher(dsp) | ||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly.
| if opts.ServerServer { | ||
| logger.Printf("Listening on %s\n", ccs) | ||
| cconn.Listen() | ||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly and skip the i's alltogether.
| case p := <-sreceive: | ||
| logger.Printf("S d:%02X p:%s\n", p.Dispatch(), p) | ||
| cconn.Send(p) | ||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly, no need for the i variable.
| logger.Printf("signal %s\n", sig) | ||
| sconn.Disconnect() | ||
| cconn.Disconnect() | ||
| for i := range opts.Positional.Source { |
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.
Here it would make more sense to iterate over the cconn array directly, no need for the i variable.
…ngle server