I may be wrong, but I guess there are hint in mono/pipeserver, search 'writeString'.
ie. read 4 byte as integer for string length, then read that many bytes as string?
never mind, I had mistaken other thing, sorry~
Hi, try to mess with the luapipe, got some problem and fixed by Dark Byte help here
(it is in lua, but should be easy convert to C#).
Here some note to return non integer type:
1. use command 3 (TLuaServerHandler.execute), it require a function reference (dword integer return from server), or a defined function name in server side, the bytes to be sent will be different in these 2 cases;
2. the bytes to be recieve should be received by each approiate type (Dword word byte string), instead read all bytes once (that's my problem, see readAll)
3. the input parameter type and return type should both use (ptNil=0, ptBoolean=1, ptInt64=2, ptInt32=3, ptNumber=4, ptString=5, ptTable=6 <Yet to be done>, ptUnknown=255 < for error? >), not LUA_TNUMBER /LUA_TSTRING etc.
4. when server result has a LUA_TNUMBER return number, it can be of Integer type (ptInt64) or double (ptNumber) depend on if it can be convert to integer, for Static Type Language like C#, it may need cautious when expecting a double return value, it may receive (ptInt64, Qword) instead of (ptNumber, double-value) if the number is a whole number/integer.
5. it seems it only can receive nil/boolean/integer/double(both number, LUA_TNUMBER)/string types, may be multiple return values.
6. Lua (in server side) is dynamic type, it may not return the type as expected, for example, for a function expected to retunr an address as integer, it may return nil due to unreadable memory. The C# side should consider such exception.