Code Monkey home page Code Monkey logo

Comments (11)

havokentity avatar havokentity commented on June 12, 2024 1

I am using Windows 10 Pro, Version 21H2, OS Build 19044.2006,
Experience: Windows Feature Experience Pack 120.2212.4180.0.

.NET target framework is net6.0, language version C# 10

(I hope that's what you mean by .NET version)

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

Actually, you should be able to just:

public class BookService
{

    [ResourceMethod]
    public Stream RequestResponse()
    {
        return File.OpenRead(@"D:\KUTE_ANIME_DESCRIPTION.OBJ");
    }

}

from genhttp.

havokentity avatar havokentity commented on June 12, 2024

Thanks for the reply!

This is awesome but unfortunately I still get this exception though the file transfer works.

image

Just ignore it and continue? The file is around 11 mb, it doesn't happen with very small files

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

What client do you use to access the service? Plain browser? Have to check the behaviour with large files ...

from genhttp.

havokentity avatar havokentity commented on June 12, 2024

Yea just plain browser, using Edge browser right now. I tried it with a Unity application also, but this time the exception was smaller.

image

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

Hm, cannot reproduce the issue with this minimal example:

Host.Create()
    .Handler(ServiceResource.From<WS>())
    .Defaults()
    .Development()
    .Console()
    .Run();


class WS
{

    [ResourceMethod]
    public Stream GetResult()
    {
        return File.OpenRead(@"C:\temp\largefile.mp4");
    }

}

Can you show me how you setup your host instance and probably provide some offending test file to me?

from genhttp.

havokentity avatar havokentity commented on June 12, 2024

Hey!

It stopped happening with the Unity application (Happened just once), but it happens always with Edge Browser. Though I don't need it to work with Edge so for me this is fine. Also even after the exception, server runs fine.

Here's my setup code. ResourceMethod stuff is exactly the same as your example.

internal class Program
    {
        static void Main(string[] args)
        {
            ushort port = 60907;
            
            Console.WriteLine($"Starting server on http://localhost:{port}");
            var server = Host.Create();
            server.Port(port);

            var api = Layout.Create()
                .AddService<APIService>("api")
                .Add(CorsPolicy.Permissive());
                
            server.Handler(api)
                    .Defaults()
                    .Development()
                    .Console()
                    .Start(); 
            Console.ReadKey();
            Console.WriteLine("Stopped. Good bye!");
        }
    }

Edit:
File just gets stuck in upload forever but the issue happens with any 15mb+ file but only with Edge browser, doesn't happen when I do a HTTP Get request from Unity 99% of the time.

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

Hm, still cannot reproduce this with your bootstrapper. May I ask which operating system (and version) and .NET version you are using?

from genhttp.

havokentity avatar havokentity commented on June 12, 2024

image
Here's a list of "classic" .NET Versions in my PC.

.NET SDK 6.0.109 and 6.0.401 are installed

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

Okay, thanks - last question: when you say "Edge", do you mean the Chromium based version of Edge?

from genhttp.

Kaliumhexacyanoferrat avatar Kaliumhexacyanoferrat commented on June 12, 2024

I am still not able to reproduce this behavior. In the sense of backlog grooming I am closing here - feel free to re-open as soon there is new information.

from genhttp.

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.