Git Product home page Git Product logo

Comments (7)

CXTretar avatar CXTretar commented on May 14, 2024

将server 的端口配置方法

- (BOOL)start{
    if (!_server.isRunning) {
        [self.server startWithOptions:@{
                                        GCDWebServerOption_Port: @6800,
                                        GCDWebServerOption_BindToLocalhost: @YES,GCDWebServerOption_AutomaticallySuspendInBackground: @YES
                                        } error:NULL];
    }
    
    return _server.isRunning;
}

改为

- (BOOL)start{
    if (!_server.isRunning) {
       [self.server startWithPort:6800 bonjourName:nil];
    }    
    return _server.isRunning;
}

测试是可以正确设置端口修复Bug.

from webbrowser.

zhongwuzw avatar zhongwuzw commented on May 14, 2024

@CXTretar 你好,这个bug是必现的么?请提供iOS版本、设备等,我定位一下。

from webbrowser.

CXTretar avatar CXTretar commented on May 14, 2024

@zhongwuzw 应该是必现的,因为我自己的项目中使用同样的方式start,也出现问题,我重新下载master测试确定一下,测试用的模拟器iPhone 6 iOS 11.2. 真机 iPhone 5s iOS 10.2 。

from webbrowser.

zhongwuzw avatar zhongwuzw commented on May 14, 2024

@CXTretar ,我这边没法复现,根据你提供的URL,端口号显示为0,也就是_options赋值的时候6800没赋值上,你这边能在这打个断点调试一下么?

// GCDWebServer.m
- (BOOL)_start:(NSError**)error {
  GWS_DCHECK(_source4 == NULL);

  NSUInteger port = [_GetOption(_options, GCDWebServerOption_Port, @0) unsignedIntegerValue];

from webbrowser.

CXTretar avatar CXTretar commented on May 14, 2024

@zhongwuzw 重新下载新的项目运行是没有问题的,但是早上我测试了很多遍一直有这个问题,这个会跟网络环境有关系?

from webbrowser.

CXTretar avatar CXTretar commented on May 14, 2024

image
这个错误是怎么造成的

from webbrowser.

CXTretar avatar CXTretar commented on May 14, 2024

无法重现了,应该是模拟器出的异常。

from webbrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.