func spawnServerHandler(reqchan chan request, hostname string) { sock, err := net.Dial("tcp", hostname) if err != nil { log.Panicf("Failed to connect %s: %v", hostname, err) } conn := memcached.ClientFromSock(sock) go runDownstream(&conn, reqchan) }
func spawnServerHandler(reqchan chan request, hostname string, bucketName string) { sock, err := net.Dial("tcp", hostname) if err != nil { log.Panicf("Failed to connect %s: %v", hostname, err) } conn := memcached.ClientFromSock(sock) authReq := buildPlainAuthRequest(bucketName, "") authBuf := make([]byte, authReq.Size()) authReq.FillBytes(authBuf) log.Printf("authBuf: %v", authBuf) _, err = conn.Socket.Write(authBuf) if err != nil { log.Panic(err) } go runDownstream(&conn, reqchan) }