diff --git a/synced-pool.go b/synced-pool.go index b20b317..70b298f 100644 --- a/synced-pool.go +++ b/synced-pool.go @@ -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