Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

FormatException: Invalid port (at character 16) #64

@paulobreim

Description

@paulobreim

Here is my code:
HttpServer.bind(InternetAddress.anyIPv4, port).then((server) {
print('Servindo em ${server.address}:${server.port}');
server.listen((HttpRequest request) {
handleGetRequest(request); // check de URL
request.response
..close();
});
});
I don't know why, but some times, the program stop with:
FormatException: Invalid port (at character 16)
http://0.0.0.0:81login.cgi
Sure that I am using port 81, but the port does not import.
This error occur even if there are anybody connecting.

Debuging the app I can see that the program is waiting for a connection in the line
server.listen((HttpRequest request)

From time to time, simply gives the message without anyone connecting

Another fact is that I am not put
import 'package:http_server/http_server.dart';
because when I put, I receive message that Target of URI doesn't exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions