@@ -31,17 +31,25 @@ static void Main(string[] args)
3131 } ;
3232 ConnectionCloseFrame frame = new ConnectionCloseFrame ( ErrorCode . SERVER_BUSY , "The server is too busy to process your request." ) ;
3333 MaxStreamIdFrame msidframe = new MaxStreamIdFrame ( 144123 , StreamType . ClientUnidirectional ) ;
34- packet . AttachFrame ( frame ) ;
34+ // packet.AttachFrame(frame);
3535 packet . AttachFrame ( msidframe ) ;
3636
3737 byte [ ] data = packet . Encode ( ) ;
38+ string b64 = ToBase64 ( data ) ;
39+
40+ byte [ ] shpdata = new byte [ ] { 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 } ;
41+ ShortHeaderPacket shp = new ShortHeaderPacket ( ) ;
42+ shp . DestinationConnectionId = 124 ;
43+ shp . PacketNumber = 2 ;
44+ shp . AttachFrame ( new StreamFrame ( ) { StreamId = 1 , Length = new VariableInteger ( ( UInt64 ) shpdata . Length ) , StreamData = shpdata , Offset = 0 } ) ;
45+
46+ string shpb64 = ToBase64 ( shp . Encode ( ) ) ;
47+
3848 packet . Decode ( data ) ;
3949
4050 byte [ ] ccfData = frame . Encode ( ) ;
4151 frame . Decode ( new ByteArray ( ccfData ) ) ;
4252
43- string b64 = ToBase64 ( data ) ;
44-
4553 byte [ ] streamIdData = new StreamId ( 123 , StreamType . ClientUnidirectional ) ;
4654 StreamId streamId = streamIdData ;
4755
@@ -52,7 +60,17 @@ static void Main(string[] args)
5260
5361 private static void Listener_OnClientConnected ( QuicContext obj )
5462 {
55- throw new NotImplementedException ( ) ;
63+ System . Console . WriteLine ( "Client connected." ) ;
64+ obj . OnDataReceived += Obj_OnDataReceived ;
65+ }
66+
67+ private static void Obj_OnDataReceived ( byte [ ] obj )
68+ {
69+ System . Console . WriteLine ( "Data received" ) ;
70+ foreach ( byte b in obj )
71+ {
72+ System . Console . Write ( string . Format ( "{0}," , b ) ) ;
73+ }
5674 }
5775
5876 static string ToBase64 ( byte [ ] data )
0 commit comments