Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg not rebuild? #18

Open
dfklegend opened this issue Sep 21, 2019 · 0 comments
Open

msg not rebuild? #18

dfklegend opened this issue Sep 21, 2019 · 0 comments

Comments

@dfklegend
Copy link

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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant