client.connect-persistent.json 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [
  2. {
  3. "function": "stream_context_create",
  4. "params": [],
  5. "return": "@mock-stream-context"
  6. },
  7. {
  8. "function": "stream_socket_client",
  9. "params": [
  10. "tcp:\/\/localhost:8000",
  11. null,
  12. null,
  13. 5,
  14. 5,
  15. "@mock-stream-context"
  16. ],
  17. "return": "@mock-stream"
  18. },
  19. {
  20. "function": "get_resource_type",
  21. "params": [
  22. "@mock-stream"
  23. ],
  24. "return": "persistent stream"
  25. },
  26. {
  27. "function": "get_resource_type",
  28. "params": [
  29. "@mock-stream"
  30. ],
  31. "return": "persistent stream"
  32. },
  33. {
  34. "function": "stream_set_timeout",
  35. "params": [
  36. "@mock-stream",
  37. 5
  38. ],
  39. "return": true
  40. },
  41. {
  42. "function": "fwrite",
  43. "params": [
  44. "@mock-stream"
  45. ],
  46. "return-op": "key-save",
  47. "return": 248
  48. },
  49. {
  50. "function": "stream_get_line",
  51. "params": [
  52. "@mock-stream",
  53. 1024,
  54. "\r\n\r\n"
  55. ],
  56. "return-op": "key-respond",
  57. "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
  58. },
  59. {
  60. "function": "fwrite",
  61. "params": [
  62. "@mock-stream"
  63. ],
  64. "return": 13
  65. }
  66. ]