Index: /branches/binary/server/t/binary.t
===================================================================
--- /branches/binary/server/t/binary.t (revision 682)
+++ /branches/binary/server/t/binary.t (revision 764)
@@ -15,9 +15,10 @@
 use constant CMD_DELETE  => 4;
 use constant CMD_INCR    => 5;
-use constant CMD_QUIT    => 6;
-use constant CMD_FLUSH   => 7;
-use constant CMD_GETQ    => 8;
-use constant CMD_NOOP    => 9;
-use constant CMD_VERSION => 10;
+use constant CMD_DECR    => 6;
+use constant CMD_QUIT    => 7;
+use constant CMD_FLUSH   => 8;
+use constant CMD_GETQ    => 9;
+use constant CMD_NOOP    => 10;
+use constant CMD_VERSION => 11;
 
 use constant CMD_GETS    => 50;
@@ -36,8 +37,8 @@
 use constant INCRDECR_PKT_FMT => "NNNNN";
 
-use constant REQ_MAGIC_BYTE => 0x0f;
-use constant RES_MAGIC_BYTE => 0xf0;
-
-use constant PKT_FMT => "CCCxNN";
+use constant REQ_MAGIC_BYTE => 0x80;
+use constant RES_MAGIC_BYTE => 0x80;
+
+use constant PKT_FMT => "CCSCxxxNN";
 
 #min recv packet size
@@ -71,4 +72,5 @@
 };
 
+diag "Flushing...";
 $mc->flush;
 
@@ -76,5 +78,5 @@
 	diag "Test Version";
 	my $v = $mc->version;
-	ok(defined $v && length($v), "Proper version");
+	ok(defined $v && length($v), "Proper version: $v");
 }
 
@@ -243,5 +245,5 @@
 
 	my $host = shift || '127.0.0.1';
-	my $port = shift || 11212;
+	my $port = shift || 11211;
 
 	my $sock = IO::Socket::INET->new(PeerHost => $host, PeerPort => $port);
@@ -275,5 +277,6 @@
 	my $extralen = length($extraHeader);
 
-	my $msg = pack(::PKT_FMT, ::REQ_MAGIC_BYTE, $cmd, $keylen, $opaque, $keylen + $vallen + $extralen);
+	my $msg = pack(::PKT_FMT, ::REQ_MAGIC_BYTE, $cmd, $keylen, $extralen,
+                    $keylen + $vallen + $extralen, $opaque);
 	return $self->{socket}->send($msg . $extraHeader . $key . $val);
 }
@@ -287,5 +290,6 @@
 	Test::More::is(length($response), ::MIN_RECV_PACKET, "Expected read length");
 
-	my ($magic, $cmd, $errcode, $opaque, $remaining) = unpack(::PKT_FMT, $response);
+	my ($magic, $cmd, $errcode, $extralen, $remaining, 
+        $opaque) = unpack(::PKT_FMT, $response);
 
 	Test::More::is($magic, ::RES_MAGIC_BYTE, "Got proper magic");
