Giter Site home page Giter Site logo

fast-tcp's People

Contributors

alemures avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fast-tcp's Issues

Timeout

Hey, I noticed the project is not being actively maintained recently so I'm not sure you're reading this, How would you go about adding a TTL feature to the protocol? I'm thinking of adding it myself and was wondering what would be the best way. The purpose is to trigger an error after emit if a given number of ms has passed. I can implement this by wrapping the response without a setTimeout but the message would still exist in the queue and pass on to the server

BinaryStream from Socket not working

In the following sample code no messages are sent after the 10th or 11th run.
Tested on MacOS 10.12.4 / Node 6.10.x / Electron 1.6.7

SERVER:

import { createWriteStream } from "fs";

const server = new Server();

server.on('connection', (socket) => {
    console.log('connected');

    socket.on('image', function (readStream, info, callback) {
        const rootPath = '/Users/thomas/Documents/Temp/';

        let writeStream = createWriteStream(rootPath + info.name);

        readStream.pipe(writeStream);

        writeStream.on('finish', () => {
            callback('image transfer successfully');
        });
    });

});

server.listen(5000);

CLIENT:

import { createReadStream } from "fs";

const socket = new Socket({
    host: 'localhost',
    port: 5000
});

socket.on('connect', () => {
    let counter = 1;

    setInterval(() => {
        const testFile = '/Users/thomas/Documents/test.jpg';

        let writeStream = socket.stream('image', { name: Math.random() + '-test.jpg' }, (result) => {
            console.log('answer from server: ', result);
        });

        createReadStream(testFile).pipe(writeStream);

        console.log('file transfered: ', counter);

        counter++;

    }, 5000);

});

_superEmit

Hi Alejandro:
I'm confused when reading your source code, and I have a questions:
In "Server.js", the Server object have a prototype function "_superEmit". Which object will it emit msg to ?
Thank you!

Share server interfaces

Hello Alemures,

Here a is a feature i though for fast-tcp:

Create a sort of router allowing to share messages trough different network interfaces (contextes).
Example: when you want to run the same service on a socket file and on tcp socket

All the best

Login event

Docs doesn't descibe the login event an its handling...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.