remove error channel
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
This commit is contained in:
@@ -29,7 +29,6 @@ func (c *Client) Close() {
|
|||||||
|
|
||||||
type CartTCPClient struct {
|
type CartTCPClient struct {
|
||||||
net.Conn
|
net.Conn
|
||||||
Errors chan error
|
|
||||||
ErrorCount int
|
ErrorCount int
|
||||||
address string
|
address string
|
||||||
*CartPacketQueue
|
*CartPacketQueue
|
||||||
@@ -41,7 +40,6 @@ func NewCartTCPClient(address string) (*CartTCPClient, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &CartTCPClient{
|
return &CartTCPClient{
|
||||||
Errors: make(chan error),
|
|
||||||
ErrorCount: 0,
|
ErrorCount: 0,
|
||||||
Conn: connection,
|
Conn: connection,
|
||||||
address: address,
|
address: address,
|
||||||
@@ -53,10 +51,7 @@ func (m *CartTCPClient) Connect() error {
|
|||||||
if m.Conn == nil {
|
if m.Conn == nil {
|
||||||
connection, err := net.Dial("tcp", m.address)
|
connection, err := net.Dial("tcp", m.address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
m.Errors <- err
|
|
||||||
m.ErrorCount++
|
m.ErrorCount++
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
m.ErrorCount = 0
|
m.ErrorCount = 0
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ func Dial(address string) (*Client, error) {
|
|||||||
|
|
||||||
type TCPClient struct {
|
type TCPClient struct {
|
||||||
net.Conn
|
net.Conn
|
||||||
Errors chan error
|
|
||||||
ErrorCount int
|
ErrorCount int
|
||||||
address string
|
address string
|
||||||
*PacketQueue
|
*PacketQueue
|
||||||
@@ -37,7 +36,6 @@ func NewTCPClient(address string) (*TCPClient, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &TCPClient{
|
return &TCPClient{
|
||||||
Errors: make(chan error),
|
|
||||||
ErrorCount: 0,
|
ErrorCount: 0,
|
||||||
Conn: connection,
|
Conn: connection,
|
||||||
address: address,
|
address: address,
|
||||||
@@ -59,7 +57,6 @@ func (m *TCPClient) Connect() error {
|
|||||||
|
|
||||||
func (m *TCPClient) HandleConnectionError(err error) error {
|
func (m *TCPClient) HandleConnectionError(err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
m.Errors <- err
|
|
||||||
m.ErrorCount++
|
m.ErrorCount++
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user