Skip to content

msg not rebuild? #18

Description

@dfklegend

there is a test from your example,
when msg greater than 512,it will splite to some mini msg(512)
and not rebuild in other peer.

var gobackn = require('../../lib');
var dgram = require('dgram');

var serverSocket = dgram.createSocket('udp4');
var clientSocket = dgram.createSocket('udp4');

serverSocket.bind(3001);

console.log('Bound the server socket to port 3001');

var server = new gobackn.Server(serverSocket);
var client = new gobackn.Client(clientSocket, '127.0.0.1', 3001);

server.on('close', function () {
serverSocket.close();
});

client.on('close', function () {
clientSocket.close();
});

server.on('connection', function (connection) {
connection.on('data', function (data) {
console.log('data:' + data.toString('utf8'));
});

connection.send(new Buffer('Hello, Client!'));
});

client.on('data', function (data) {
console.log('Client: %s', data.toString('utf8'));
});

var info = '';
for(var i = 0; i < 16*1024; i ++)
info += ' ' + i;

client.send(new Buffer('Hello, World!'));
client.send(new Buffer('How are you doing?'));
client.send(new Buffer(info));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions