コード例 #1
0
 public void WriteStream(object o)
 {
     _serde.Pack(_sendbuf, o);
     _sendbuf.Seek(0, SeekOrigin.Begin);
     _sendbuf.CopyTo(_stream);
     //	DumpWriteStream();
     // because if there is remained buffer size ( == sz),
     // it is not sure that SetLength(sz) keep remained buffer,
     // only when buffer is fully written to network, we reduce length.
     if (_sendbuf.Position == _sendbuf.Length)
     {
         _sendbuf.SetLength(0);
     }
 }
コード例 #2
0
ファイル: Score.cs プロジェクト: the40san/Alexey
 private static byte[] GetPostHighScoreCommand(int highScore)
 {
     MsgPack.BoxingPacker packer = new MsgPack.BoxingPacker();
     byte[] result = packer.Pack(new object[] { 0, highScore });
     return(result);
 }
コード例 #3
0
ファイル: Score.cs プロジェクト: the40san/Alexey
 private static byte[] GetCurrentHighScoreCommand()
 {
     MsgPack.BoxingPacker packer = new MsgPack.BoxingPacker();
     byte[] result = packer.Pack(new object[] { 1 });
     return(result);
 }