Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ingwie Phoenix
    @IngwiePhoenix
    ahh, good to know.
    Please let me know when you introduced that change since I will have to update my dependencies then
    小马哥
    @andot
    Maybe I will add a full workerman implementation in hprose-php in the future. :smile:
    Ingwie Phoenix
    @IngwiePhoenix
    Ahh. Feel free to go off the code I wrote. I am running the latest Workerman and it still works as expected. :)
    Though you will have a massive advantage - you can actually understand the docs…i can’t. I have a friend that speaks chinese but when I showed them to her she was all confused. XD
    小马哥
    @andot
    Yes, the chinese document is easy for me. :smile:
    Ingwie Phoenix
    @IngwiePhoenix
    You lucky. :)
    小马哥
    @andot

    I added full duplex socket binding for hprose: https://github.com/hprose/hprose/blob/master/spec.mediawiki#Full_Duplex_Socket_Binding

    Now, the nodejs version is already complete for this feature. but the php version is not ready.

    Ingwie Phoenix
    @IngwiePhoenix
    What does this feature do?
    小马哥
    @andot
    Less connections, more concurrent requests/responses.
    Ingwie Phoenix
    @IngwiePhoenix
    Sweet! I hope you can bring this to PHP soon, this will very likely help me.
    小马哥
    @andot
    I will add it to PHP as soon as possible, and it will base on swoole or workerman in php version.
    Ingwie Phoenix
    @IngwiePhoenix
    Hopefuly workerman…its really great. :)
    So far, I have had not a single problem with Workerman - all the ones I had were my own code. x)
    Ingwie Phoenix
    @IngwiePhoenix
    So here is FeatherWeight: https://github.com/DragonsInn/FeatherWeight
    It is a cache that can be accessed through hprose and is also serialized and deserialized using hprose itself, to persist as much data as possible. Its not done yet, but I thought it’d be nice to show you! :)
    小马哥
    @andot
    cool! :cool:
    Ingwie Phoenix
    @IngwiePhoenix
    I hope to develop it further. It could be osmething nice to show off as one of the use-cases of hprose. :)
    小马哥
    @andot
    I will add it to the case of hprose soon.
    小马哥
    @andot
    I add it to http://hprose.com/case.html now.
    I add a hprose online test tool : http://hprose.com/test/
    Ingwie Phoenix
    @IngwiePhoenix
    Cool!
    Ingwie Phoenix
    @IngwiePhoenix
    I just came upon something interesting. It turns out that PHP allows c-side custom serialization handlers. You mind adding that feature to the native hprose implementation? I found it here: https://github.com/msgpack/msgpack-php/blob/master/msgpack.c#L92-L96
    小马哥
    @andot
    It’s cool. I’ll try.
    Ingwie Phoenix
    @IngwiePhoenix
    Woah I saw the PECL release announcement email! Thats some seriously great work! You are so fast :o
    Ingwie Phoenix
    @IngwiePhoenix
    1.6.1 seems to break hprose-workerman:
    Fatal error: Class 'Hprose\Service' not found in /Users/Ingwie/Work/BIRD3/php_modules_ext/hprose-workerman/Service.php on line 24
    
    Call Stack:
        0.0005     265160   1. {main}() /Users/Ingwie/Work/BIRD3/php-lib/request_handler.php:0
        0.0236     821544   2. require_once('/Users/Ingwie/Work/BIRD3/php_modules_ext/hprose-workerman/HproseWorkermanService.php') /Users/Ingwie/Work/BIRD3/php-lib/request_handler.php:6
        0.0245     853480   3. require_once('/Users/Ingwie/Work/BIRD3/php_modules_ext/hprose-workerman/Service.php') /Users/Ingwie/Work/BIRD3/php_modules_ext/hprose-workerman/HproseWorkermanService.php:77
    What is the correct class to extend from, since \Hprose\Service is gone?
    小马哥
    @andot
    I removed Hprose\Service and Hprose\Client from extension.
    Because I found extension version service and client are unstable.
    Ingwie Phoenix
    @IngwiePhoenix
    Ah, so I need to use the hprose-php version here? alright, I’ll update hprose-workerman later tonight! :)
    Ingwie Phoenix
    @IngwiePhoenix
    Did you change the signature for the client.invoke function in Node? This is throwing me an error:
    ctx.client.invoke("yii_run", ctx.arg, ctx.opt, function(obj){
                        var status = obj.status || 200;
                        res.status(status);
                        for(var k in obj.headers) {
                            var v = obj.headers[k];
                            res.setHeader(k,v);
                        }
                        for(var k in obj.cookies) {
                            var v = obj.cookies[k];
                            res.cookie(k, v[0], v.opts);
                        }
                        ctx.php = obj;
                        ware.postprocess(ctx,function(ps_err,ps_res){
                            res.end(obj.body);
                            done();
                        });
                    });
    1441404586948 - Origin: Worker (PID 70307)
        [Error] TypeError: undefined is not a function
        at SocketClient.invoke (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:845:22)
        at Object.<anonymous> (/Users/Ingwie/Work/BIRD3/node-lib/front-end/php_handler.js:132:28)
        at next (/Users/Ingwie/Work/BIRD3/node_modules/ginga/index.js:250:26)
        at Object.PHPMiddleware.defs.invok (/Users/Ingwie/Work/BIRD3/node-lib/front-end/php_handler.js:26:20)
        at next (/Users/Ingwie/Work/BIRD3/node_modules/ginga/index.js:259:14)
        at Object.PHPMiddleware.defs.pre (/Users/Ingwie/Work/BIRD3/node-lib/front-end/php_handler.js:23:20)
        at next (/Users/Ingwie/Work/BIRD3/node_modules/ginga/index.js:259:14)
        at Object.(anonymous function) [as preprocess] (/Users/Ingwie/Work/BIRD3/node_modules/ginga/index.js:265:7)
        at Object.<anonymous> (/Users/Ingwie/Work/BIRD3/node-lib/front-end/php_handler.js:130:18)
        at next (/Users/Ingwie/Work/BIRD3/node_modules/ginga/index.js:259:14)
    Yeah you did. I read the source and figured it out. :)
    小马哥
    @andot
    Here is the new version documents:
    https://github.com/hprose/hprose-nodejs/wiki
    Ingwie Phoenix
    @IngwiePhoenix
    Ahh thanks :) I managed to pick up the changes from the source code, but the link will be helpful still. Thank you
    Ingwie Phoenix
    @IngwiePhoenix
    I just noticed that inside hprose for node, there is no actual way of getting a function list. I used HproseTcpClient to install a client connection, and wanted to use that to peek at the currently exported function list to verify that I did things right. Is there a way to send just 'z' to the hprose instance without having to use a separate net client?
    Ingwie Phoenix
    @IngwiePhoenix
    Good news, I got it working what i wanted :)
    I used nc tool to send the z to hprose, it displayed the function list
    doing it natively from NodeJS would be helpful still, though.
    小马哥
    @andot
    var client = new HproseTcpClient('tcp://127.0.0.1:3333', true);
    client.ready(function(stub) {
        console.log(stub);
    });
    stub is the function list.
    Ingwie Phoenix
    @IngwiePhoenix
    Ohhh thank you!
    Ingwie Phoenix
    @IngwiePhoenix
    Hey there @andot! I am currently working on open-sourcing the WebServer system that my project uses, that allows it to use PHP applications inside NodeJS. But I am running into one very, very strange behaviour.
    Here are two objects. The first one is a context object that was created off a request by Chrome.
    The second came from the curl tool.
    And the second one tribbers an error.
    The requests:
    { request: 
       { url: 'http://localhost:8080/',
         query: {},
         postData: {},
         cookies: { _ga: 'GA1.1.552601832.1440916040' },
         body: undefined,
         files: {},
         server: 
          { REQUEST_METHOD: 'GET',
            QUERY_STRING: null,
            PHP_SELF: '/',
            SCRIPT_FILENAME: '/',
            SCRIPT_NAME: '/',
            REQUEST_URI: '/',
            DOCUMENT_URI: '/',
            REMOTE_ADDR: '127.0.0.1',
            REMOTE_PORT: 65444,
            SERVER_ADDR: undefined,
            SERVER_PORT: undefined,
            SERVER_NAME: undefined,
            SERVER_PROTOCOL: 'HTTP/1.1',
            GATEWAY_INTERFACE: 'nodejs/v4.2.1',
            SERVER_SOFTWARE: 'nodejs/v4.2.1',
            HOST: 'localhost:8080',
            CONNECTION: 'keep-alive',
            CACHE_CONTROL: 'max-age=0',
            ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
            'UPGRADE_INSECURE-REQUESTS': '1',
            USER_AGENT: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36',
            ACCEPT_ENCODING: 'gzip, deflate, sdch',
            ACCEPT_LANGUAGE: 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4',
            COOKIE: '_ga=GA1.1.552601832.1440916040',
            'IF_NONE-MATCH': 'W/"d-bNNVbesNpUvKBgtMOUeYOQ"' },
         method: 'GET',
         headers: 
          { host: 'localhost:8080',
            connection: 'keep-alive',
            'cache-control': 'max-age=0',
            accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
            'upgrade-insecure-requests': '1',
            'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36',
            'accept-encoding': 'gzip, deflate, sdch',
            'accept-language': 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4',
            cookie: '_ga=GA1.1.552601832.1440916040',
            'if-none-match': 'W/"d-bNNVbesNpUvKBgtMOUeYOQ"' } },
      response: {},
      optional: {} }
    { request: 
       { url: 'http://localhost:8080/',
         query: {},
         postData: {},
         cookies: {},
         body: undefined,
         files: {},
         server: 
          { REQUEST_METHOD: 'GET',
            QUERY_STRING: null,
            PHP_SELF: '/',
            SCRIPT_FILENAME: '/',
            SCRIPT_NAME: '/',
            REQUEST_URI: '/',
            DOCUMENT_URI: '/',
            REMOTE_ADDR: '127.0.0.1',
            REMOTE_PORT: 65446,
            SERVER_ADDR: undefined,
            SERVER_PORT: undefined,
            SERVER_NAME: undefined,
            SERVER_PROTOCOL: 'HTTP/1.1',
            GATEWAY_INTERFACE: 'nodejs/v4.2.1',
            SERVER_SOFTWARE: 'nodejs/v4.2.1',
            USER_AGENT: 'curl/7.38.0',
            HOST: 'localhost:8080',
            ACCEPT: '*/*' },
         method: 'GET',
         headers: 
          { 'user-agent': 'curl/7.38.0',
            host: 'localhost:8080',
            accept: '*/*' } },
      response: {},
      optional: {} }
    And the error:
    TypeError: Cannot read property 'name' of undefined
        at getClassName (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:33:12)
        at serialize (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:158:29)
        at writeMap (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:370:9)
        at Writer.Object.defineProperties.writeMapWithRef.value (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:513:17)
        at serialize (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:160:24)
        at writeMap (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:370:9)
        at Writer.Object.defineProperties.writeMapWithRef.value (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:513:17)
        at serialize (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:160:24)
        at writeArray (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:337:9)
        at Writer.Object.defineProperties.writeList.value (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/io/Writer.js:492:9)
        at encode (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:325:20)
        at invokeHandler (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:373:23)
        at /Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:454:13
        at Function.promise (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/common/Future.js:104:5)
        at call (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:453:30)
        at __invoke (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:349:16)
        at _invoke (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:353:16)
        at SocketClient.invoke (/Users/Ingwie/Work/BIRD3/node_modules/hprose/lib/client/Client.js:851:16)
        at Object.<anonymous> (/Users/Ingwie/Work/BIRD3/app/Foundation/WebDriver/Dispatcher.js:160:29)
    What is causing hprose to fail? The objects seem idendical, to me.
    Ingwie Phoenix
    @IngwiePhoenix
    For now, the only workaround I have is : JSON.parse(JSON.stringify(ctx)), where ctx is my context object.
    小马哥
    @andot
    var cls = obj.constructor;
        var classname = ClassManager.getClassAlias(cls);
        if (classname) return classname;
        if (cls.name) {
            classname = cls.name;
        }
    The obj.constructor is undefined. Maybe the obj is not a javascript object.
    Bison "goldeagle" Fan
    @goldeagle
    hi