Opened 10 years ago

Closed 5 years ago

Last modified 4 years ago

#11108 closed bug (no change required)

app_server WebWorker writeSize invalid on secondary connection attempts

Reported by: kallisti5 Owned by: kallisti5
Priority: normal Milestone:
Component: Servers/app_server Version: R1/Development
Keywords: html5 Cc: ttcoder
Blocked By: Blocking:
Platform: All

Description

Opening an initial connection to the app_server HTML5 target works. Any additional connections to the original port fail:

KERN: WebServer: new endpoint connection: 0x18972248
KERN: WebServer: searching handler for 'output'
KERN: WebHandler: 'output' <> 'input' 6
KERN: WebHandler: 'output' <> 'output' 0
KERN: WebServer: found handler 'output'
KERN: WebWorker: new endpoint connection: 0x18972248
KERN: WebWorker: readSize 4096
KERN: WebWorker: writeSize -1
KERN: WebWorker: writing to peer failed: General system error
KERN: WebWorker: readSize 4096
KERN: WebWorker: writeSize 4096
KERN: WebServer: new endpoint connection: 0x18971e68
KERN: WebServer: read 0 bytes, retrying
KERN: WebWorker: readSize 4096
KERN: WebWorker: writeSize -1
KERN: WebWorker: writing to peer failed: General system error
KERN: WebServer: read 0 bytes, retrying

Change History (7)

comment:1 by kallisti5, 10 years ago

testing with:

TARGET_SCREEN=html5:80 StyledEdit

comment:2 by ttcoder, 10 years ago

Cc: degea@… added

I also have the "can connect only once, then a reboot is needed" symptom using the RemoteDesktop target; didn't check if the underlying problem is the same as here on the HTML5 target but at any rate this is very interesting

comment:3 by kallisti5, 10 years ago

I found that killing and restarting the app_server doesn't help. However, if I choose a different port, things will work on that port (well.. once)

comment:4 by ttcoder, 10 years ago

Could it be that app_server needs to call setsockopt(..SO_REUSEADDR) or SO_REUSEPORT ? The intertubes say that the use-case for needing it is if bind() returns error EINUSE. In fact,

  • searching for either constant comes up empty in ap_server/
  • HTML5DrawingEngine.cpp:92 could potentially affect value EINUSE to fInitStatus
  • the trouble is that the init status is not used for error reporting, only for bailing out in ScreenManager.cpp:194
  • looking at the code more closely and/or adding tracing could reveal if app_server and/or the client might attempt some uncalled-for write on an unbinded socket; if so, then setsockopt()might be the answer? Or maybe I'm just blowing smoke and the "write to peer failed" is something else entirely

Hmmm re-reading myself I realize the problematic bind() could be on the client side too, not just app_server side. Also will keep this link for my reference: http://www.freelists.org/post/haiku-development/app-server-html5-interface

comment:5 by waddlesplash, 5 years ago

Resolution: no change required
Status: newclosed

HTML5 backend for app_server was removed in favor of the HTML5 RemoteDesktop client.

comment:6 by ttcoder, 5 years ago

Cc: ttcoder added; degea@… removed

comment:7 by nielx, 4 years ago

Milestone: Unscheduled

Remove milestone for tickets with status = closed and resolution != fixed

Note: See TracTickets for help on using tickets.