Skip to content

Commit

Permalink
back to hunt 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuchun committed Mar 12, 2019
1 parent 75a3969 commit c9a5780
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions source/hunt/imf/io/client.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module hunt.imf.io.client;

import hunt.collection.ByteBuffer;

import hunt.net;

import hunt.imf.core.dispatcher;
Expand Down Expand Up @@ -48,9 +48,9 @@ class Client
if(_close !is null)
_close(context);
});
tcp.handler((ByteBuffer buffer) {
tcp.handler((in ubyte[] data) {
auto context = cast(Context)tcp.getAttachment();
auto list = context.parser.consume(cast(byte[])buffer.getRemaining());
auto list = context.parser.consume(cast(byte[])data);
foreach(p ; list)
_dispatcher.dispatch(context , p);
});
Expand Down
4 changes: 2 additions & 2 deletions source/hunt/imf/io/context.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ void sendMessage(M)(Context context,int64_t message_id , M m , VoidHandler finis
{
auto packet = new Packet(message_id , m.toProtobuf.array);
auto data = packet.data;
context.sock.write(packet.data);
context.sock.write(packet.data , finish);
}

void sendMessage(Context context,int64_t message_id ,VoidHandler finish = null )
{
auto packet = new Packet(message_id);
auto data = packet.data;
context.sock.write(packet.data);
context.sock.write(packet.data , finish);
}

void close(Context context)
Expand Down
4 changes: 2 additions & 2 deletions source/hunt/imf/io/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Server
_close(context);
});
sock.handler(
(ByteBuffer buffer) {
(in ubyte[] data) {
auto context = cast(Context)tcp.getAttachment();
auto list = context.parser.consume(cast(byte[])buffer.getRemaining());
auto list = context.parser.consume(cast(byte[])data);
foreach(p ; list)
_dispatcher.dispatch(context , p);
}
Expand Down

0 comments on commit c9a5780

Please sign in to comment.