Improve the parser, automatically set empty destinations to TRANSIENT when using a dialer, better error handling, when a socket gets closed, increment the ID and re-create it

This commit is contained in:
idk
2020-11-29 16:23:55 -05:00
parent 63833f24ab
commit 5fda56e88d

View File

@ -7,7 +7,7 @@ import (
// StreamConnect asks SAM for a TCP-Like connection to dest, has to be called on a new Client
func (c *Client) StreamConnect(id int32, dest string) error {
if dest == "" {
dest = "TRANSIENT"
return nil
}
r, err := c.sendCmd("STREAM CONNECT ID=%d DESTINATION=%s %s %s\n", id, dest, c.from(), c.to())
if err != nil {