POMP, the PHPOS Object Mapping Protocol version 1 (c) 2003 by sIX <six@t0x.net>
-------------------------------------------------------------------------------

Overview :

- Works on top of TCP (default port 20100)
- After the connection is established, the server must start accepting 
  messages from the client.

Message types :

PHPOS_MSG_NEWINST	1
PHPOS_MSG_BIND		2
PHPOS_MSG_PROPGET	3
PHPOS_MSG_PROPSET	4
PHPOS_MSG_MCALL		5
PHPOS_MSG_UNBIND	6

Typical packet :

0  - 5          "PHPOS"
5  - 6          Protocol version (unsigned char)
6  - 10         Request ID (unsigned int - auto increment)
10 - 11         Message type (unsigned char - see above)
11 - 15         Message length (unsigned int - exculding header)
15 - 15+len     Message content

Message content varies with message type, but is always a php serialized 
string representing a php associative array of arguments.

Access mode and Error code int fields correspondances are below

Object access modes :

PHPOS_AC_OWNER		0	Only object owner can bind to object
PHPOS_AC_AUTH		1	Only identified sessions can bind to object
PHPOS_AC_WORLD		2	Everyone can bind to object


Error codes used in messages :

PHPOS_EOK		0
PHPOS_ENOTFOUND		1
PHPOS_ENOTALLOWED	2


Properties policy types :

PHPOS_PP_LOOSE		0	Allow set/get of undefined object properties
PHPOS_PP_STRICT		1	Forbid set/get of undefined object properties


Message content by type (* required) :

PHPOS_MSG_NEWINST REQUEST

* "oid"		New PHPOS Object ID (string)
* "class"	Class name (string)
  "parameters"  Constructor parameters (array)
  "login"	PHPOS login (string)
  "password"	PHPOS password (string)
  "owner"	Object Owner (string - default = creator)
  "access_mode"	Object Access Mode (see above)

PHPOS_MSG_NEWINST REPLY

* "created"	New instance creation successful (bool)
- if (created == true)
  "properties"	Object properties list (array)
  "methods"	Object methods list (array)
  "prop_policy" Properties set/get policy (char)
- else
  "error"	Error code (int)


PHPOS_MSG_BIND REQUEST

* "oid"		PHPOS Object ID (string)
  "login"	PHPOS login (string)
  "password"	PHPOS password (string)

PHPOS_MSG_BIND REPLY

* "bound"	Bind successful (bool)
- if (bound == true)
  "properties"	Object properties list (array)
  "methods"	Object methods list (array)
  "prop_policy" Properties set/get policy (char)
- else
  "error"	Error code (int)


PHPOS_MSG_PROPGET REQUEST

* "oid"		PHPOS Object ID (string)
* "property"	Property name

PHPOS_MSG_PROPGET REPLY

* "value"	Property value (mixed)
  "error"	Error code (int)


PHPOS_MSG_PROPSET REQUEST

* "oid"		PHPOS Object ID (string)
* "property"	Property name
* "value"	New value

PHPOS_MSG_PROPSET REPLY

  "error"	Error code (int)


PHPOS_MSG_MCALL REQUEST

* "oid"		PHPOS Object ID (string)
* "method"	Method name (string)
* "parameters"	Method parameters (array)

PHPOS_MSG_MCALL REPLY

* "return"	Method return (mixed)
  "error"	Error code (int)


PHPOS_MSG_UNBIND REQUEST

* "oid"		PHPOS Object ID (string)

PHPOS_MSG_UNBIND REPLY

* "unbound"	Unbind successful (bool)
- if (bound == false)
  "error"	Error code (int)

