Coder Social home page Coder Social logo

lgtm-migrator / azmisahin-software-web-package-tcp-nodejs-javascript-v1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azmisahin/azmisahin-software-web-package-tcp-nodejs-javascript-v1

0.0 0.0 0.0 278 KB

A Tcp server can be a TCP or an IPC server depending on what it listens to

License: MIT License

Shell 5.37% JavaScript 93.95% Gherkin 0.68%

azmisahin-software-web-package-tcp-nodejs-javascript-v1's Introduction

Introduction

A Tcp server can be a TCP or an IPC server depending on what it listens to.

Example

const TraceManager = require('trace-manager')

// package define
const Tcp = require('package-tcp-javascript')

// module instance
var tcp = new Tcp()

// trace manager
var tracking = new TraceManager()

// new tcp server
var server = tcp.server()

/**
 * tcp warning
 * @param {event} event event.chunk, event.stream, event.error
 */
tcp.event('tcp-warn', () => {
  // Tracking
  tracking.warn(`${process.pid}\ttcp-warning\t X\t`)
})

/**
 * tcp stream
 * @param {event} event event.chunk, event.stream
 */
tcp.event('tcp-stream', (event) => {
  tracking.info(`${process.pid}\ttcp-stream\t⚡️\t`, {
    from: event.stream.remoteAddress,
    data: event.chunk,
  })
})

/**
 * tcp response
 * @param {event} event event.chunk, event.stream
 */
tcp.event('tcp-response', (event) => {
  tracking.info(`${process.pid}\ttcp-response\t⏪\t`, {
    from: event.stream.remoteAddress,
    data: event.chunk,
  })
})

// listener
server.listen(parseInt(process.env.TCP_PORT), () => {
  // Tracking [ info ]
  tracking['info'](`${process.pid}\ttcp-server\t✅\t`, parseInt(process.env.TCP_PORT))
})

Getting Started

TO DO: Things to do when getting started on this project.

Build and Test

TODO: Will apply your code and project building standards to templates.

  • The tests will be applied as in the template projects.
  • Development and operation will be planned as test/slot/production.

Contribute

TODO : The best method of making a contribution will be to comply with the following items.

  • Work with algorithms and flowcharts to solve problems.
  • Make pull requests to version control systems.
  • Stick to Architecture and Design Patterns apps.
  • Take care to develop applications with Domain Based Design / Test-oriented development approaches.
  • Stick to the architectural patterns used in abstraction software like Model-View-Controller.
  • Be consistent in executing maintainable practices with Object Oriented Programming (abstraction, encapsulation, inheritance and polymorphism...) techniques.
  • Use behavior-oriented development tools effectively.
  • Make it a habit to use Integration testing / Unit Testing / Functional Testing / Automation Tests.
  • Be persistent in applying metrics that describe how well the source code has been tested. [ have something to show at meetings: ) ]
  • Send your code with traditional commit messages, make your code understandable with static code analysis tools, "code documentation" tools.
  • Build event-driven, scalable service applications with serverless application development platforms.
  • Follow the steps to improve threading techniques like in services or mobile apps.

While starting

In the project; principles and architectural examples of development, code submission, consistent coding styles and development in team environment have been implemented.

azmisahin-software-web-package-tcp-nodejs-javascript-v1's People

Contributors

azmisahin avatar

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.