Previous 199869 Revisions Next

r30989 Monday 16th June, 2014 at 06:38:30 UTC by Miodrag Milanović
Update to latest (nw)
[src/emu]webengine.c
[src/lib/web]mongoose.c

trunk/src/emu/webengine.c
r30988r30989
271271      // This handler is called for each incoming websocket frame, one or more
272272      // times for connection lifetime.
273273      // Echo websocket data back to the client.
274      //const char *msg = "update_machine";
275      //mg_websocket_write(conn, 1, msg, strlen(msg));
276274      return conn->content_len == 4 && !memcmp(conn->content, "exit", 4) ? MG_FALSE : MG_TRUE;
277275    } else {
278276      web_engine *engine = static_cast<web_engine *>(conn->server_param);   
trunk/src/lib/web/mongoose.c
r30988r30989
548548
549549  if ((sock = socket(sa->sa.sa_family, SOCK_STREAM, 6)) != INVALID_SOCKET &&
550550#ifndef _WIN32
551      // SO_RESUSEADDR is not enabled on Windows because the semantics of
552      // SO_REUSEADDR on UNIX and Windows is different. On Windows,
553      // SO_REUSEADDR allows to bind a socket to a port without error even if
554      // the port is already open by another program. This is not the behavior
555      // SO_REUSEADDR was designed for, and leads to hard-to-track failure
556      // scenarios. Therefore, SO_REUSEADDR was disabled on Windows.
551557      !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) &&
552558#endif
553559      !bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ?
r30988r30989
49314937
49324938    case NS_POLL:
49334939      if (call_user(conn, MG_POLL) == MG_TRUE) {
4934        nc->flags |= NSF_FINISHED_SENDING_DATA;
4940        if (conn->ns_conn->flags & MG_HEADERS_SENT) {
4941          write_terminating_chunk(conn);
4942        }
4943        close_local_endpoint(conn);
49354944      }
49364945
49374946      if (conn != NULL && conn->endpoint_type == EP_FILE) {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team