to complex with reused connection
Some checks failed
Build and Publish / BuildAndDeploy (push) Has been cancelled

This commit is contained in:
matst80
2024-11-09 23:31:02 +01:00
parent fffb1d20c5
commit 22a80c5978

View File

@@ -108,7 +108,7 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
continue
}
log.Printf("Got connection from %s", conn.RemoteAddr().Network())
pool.AddRemoteWithConnection(conn.RemoteAddr().Network(), conn)
go pool.handleConnection(conn)
}
}()
@@ -418,17 +418,6 @@ func (p *SyncedPool) OwnerChanged(id CartId, host string) error {
return nil
}
func (p *SyncedPool) AddRemoteWithConnection(address string, connection net.Conn) error {
pool := NewRemoteGrainPool(fmt.Sprintf(address, 1337))
remote := RemoteHost{
connection: connection,
queue: NewPacketQueue(connection),
Pool: pool,
Host: address,
}
return p.addRemoteHost(address, &remote)
}
func DoPing(host *RemoteHost) error {
SendPacket(host.connection, Ping, func(w io.Writer) error {
return nil