Giter Club home page Giter Club logo

Comments (6)

LEDfan avatar LEDfan commented on May 18, 2024

The end event on the $conn object is called directly after executing the netcat command.

from socket.

LEDfan avatar LEDfan commented on May 18, 2024

BTW this is the perl code which I try to use: https://github.com/stevenshiau/clonezilla/blob/master/bin/ocs-socket by issuing ocs-socket -h ip -p 6461 -m test. This doesn’t works the first time, but it does the second time.

from socket.

LEDfan avatar LEDfan commented on May 18, 2024

I think I found the problem: http://stackoverflow.com/questions/15163778/perl-tcp-client-does-not-display-incoming-data & http://stackoverflow.com/questions/993217/php-to-perl-socket-communication.
React is waiting for a full line, but per/netcat doesn't send it. However simply sending "\n" doesn't works.

from socket.

LEDfan avatar LEDfan commented on May 18, 2024

:fireworks: just looked at it again, and my assumption in the last post was correct, in the code I fetched via composer there is this:

if ('' === $data || false === $data || feof($stream)) {

Which checks if there is and end of file before emitting the data.

However in this code repo there is this line https://github.com/reactphp/socket/blob/master/src/Connection.php#L14

Which works perfect πŸ˜ƒ. So the problem was I was using and old ratchet/react version.....

from socket.

staabm avatar staabm commented on May 18, 2024

@LEDfan Was it a typo in your composer.json (version constraint) or does the latest version which is provided by composer/packagist not contain the correct line?

from socket.

LEDfan avatar LEDfan commented on May 18, 2024

@staabm I first had:

   "require": {
        "cboden/Ratchet": "0.3.*",
        "react/zmq": "0.2.*",
        "phpseclib/phpseclib": "2.0.*@dev"
    }

Now I have:

   "require": {
     "cboden/ratchet": "0.3.*",
    "react/zmq": "0.3.*",
    "phpseclib/phpseclib": "0.3.*"
  }

from socket.

Related Issues (20)

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.