.NET Core port - DO NOT MERGE #175

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
5 participants
@darkl
Collaborator

darkl commented May 2, 2016

Hi,

I tried for fun to make this library be .NET Core compatible.

I made a project.json file and made it compile, note that I changed some things: there is no such thing "InvariantCultureIgnoreCase", so I replaced it with "OrdinalIgnoreCase",
there are no more "Close" methods for streams and sockets, so I replaced it with "Dispose".

I also didn't reimplement QueuedStream since I'm not sure if this hack is needed for .NET Core. I also didn't covert the tests.

I didn't try this, I don't know if it works.

I'm opening this pull request, just for the case that anyone wants to continue this work on the port. Please don't merge it until tests are converted, pass, and until this is actually tested.

Best regards,
Elad

@statianzo

This comment has been minimized.

Show comment
Hide comment
@statianzo

statianzo May 2, 2016

Owner

Slick work.

Owner

statianzo commented May 2, 2016

Slick work.

@AdrianBathurst

This comment has been minimized.

Show comment
Hide comment
@AdrianBathurst

AdrianBathurst May 3, 2016

Thanks!! I'll be needing this port soon, so thank you very much!

Thanks!! I'll be needing this port soon, so thank you very much!

@NVentimiglia

This comment has been minimized.

Show comment
Hide comment
@NVentimiglia

NVentimiglia Jun 27, 2016

+1

DotNetCore/Kestral version of my server dropped to 5k RPS... from an easy 50k.

+1

DotNetCore/Kestral version of my server dropped to 5k RPS... from an easy 50k.

@NVentimiglia

This comment has been minimized.

Show comment
Hide comment
@NVentimiglia

NVentimiglia Jul 9, 2016

The dependency NETStandard.Library >= 1.6.0 could not be resolved. Fleck G:\Drive\Avarice\SignalMQ\Fleck-master\core\Fleck\project.json 5

The dependency NETStandard.Library >= 1.6.0 could not be resolved. Fleck G:\Drive\Avarice\SignalMQ\Fleck-master\core\Fleck\project.json 5

@NVentimiglia

This comment has been minimized.

Show comment
Hide comment
@NVentimiglia

NVentimiglia Jul 9, 2016

After some fiddling, I got the project down to 4 errors with the following

`
{
"title": "Fleck",
"version": "1.0.0-*",

"dependencies": {
"NETStandard.Library": "1.6.0"
},

"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
},

"buildOptions": {
"allowUnsafe": true, "define": [ "NETCORE" ]
}
}
`

The errors being the removal of the BeginAsync/EndAsync and missing System.Security.SSLStream

Do we have an ETA when this will be ready for testing. I recently got the microsoft websocket up to 800,000 OPS would like to test out fleck again. @darkl

After some fiddling, I got the project down to 4 errors with the following

`
{
"title": "Fleck",
"version": "1.0.0-*",

"dependencies": {
"NETStandard.Library": "1.6.0"
},

"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
},

"buildOptions": {
"allowUnsafe": true, "define": [ "NETCORE" ]
}
}
`

The errors being the removal of the BeginAsync/EndAsync and missing System.Security.SSLStream

Do we have an ETA when this will be ready for testing. I recently got the microsoft websocket up to 800,000 OPS would like to test out fleck again. @darkl

@darkl

This comment has been minimized.

Show comment
Hide comment
@darkl

darkl Jul 9, 2016

Collaborator

@NVentimiglia, I worked on this a bit today.

This works fine on my machine with .NET Core RTM:

dotnet restore
dotnet build src\Fleck src\Samples\ConsoleApp
cd src\Samples\ConsoleApp
dotnet run

Tests don't compile since a .NET Core compatible Moq isn't available yet.

I'm not sure if I'll finish this, but you're welcome to continue from where I've stopped.

Elad

Collaborator

darkl commented Jul 9, 2016

@NVentimiglia, I worked on this a bit today.

This works fine on my machine with .NET Core RTM:

dotnet restore
dotnet build src\Fleck src\Samples\ConsoleApp
cd src\Samples\ConsoleApp
dotnet run

Tests don't compile since a .NET Core compatible Moq isn't available yet.

I'm not sure if I'll finish this, but you're welcome to continue from where I've stopped.

Elad

@NVentimiglia

This comment has been minimized.

Show comment
Hide comment
@NVentimiglia

NVentimiglia Jul 9, 2016

7/9/2016 12:31:43 PM [Info] Server started at ws://0.0.0.0:5000 (actual port 5000)
One or more errors occurred. (Attempt by method 'Fleck.SocketWrapper.Accept(System.Action1<Fleck.ISocket>, System.Action1<System.Exception>)' to access method 'System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback, System.Object)' failed.)
Terminating

7/9/2016 12:31:43 PM [Info] Server started at ws://0.0.0.0:5000 (actual port 5000)
One or more errors occurred. (Attempt by method 'Fleck.SocketWrapper.Accept(System.Action1<Fleck.ISocket>, System.Action1<System.Exception>)' to access method 'System.Net.Sockets.Socket.BeginAccept(System.AsyncCallback, System.Object)' failed.)
Terminating

@darkl

This comment has been minimized.

Show comment
Hide comment
@darkl

darkl Jul 9, 2016

Collaborator

Are you using the latest version? (netcore branch)
The latest version doesn't call BeginAccept at all.

Elad

Collaborator

darkl commented Jul 9, 2016

Are you using the latest version? (netcore branch)
The latest version doesn't call BeginAccept at all.

Elad

+
+ public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ return _stream.WriteAsync(buffer, offset, count, cancellationToken);

This comment has been minimized.

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

+
+ public override Task FlushAsync(CancellationToken cancellationToken)
+ {
+ return _stream.FlushAsync(cancellationToken);

This comment has been minimized.

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

+
+ public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
+ {
+ return _stream.CopyToAsync(destination, bufferSize, cancellationToken);

This comment has been minimized.

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

@bilal-fazlani

bilal-fazlani Feb 2, 2017

Shouldn't this be awaited ?

This comment has been minimized.

@statianzo

statianzo Feb 2, 2017

Owner

awaiting would just wrap the CopyToAsync task with another task that does nothing but return the original result. Why do you think it should be wrapped?

@statianzo

statianzo Feb 2, 2017

Owner

awaiting would just wrap the CopyToAsync task with another task that does nothing but return the original result. Why do you think it should be wrapped?

This comment has been minimized.

@bilal-fazlani

bilal-fazlani Feb 3, 2017

Never really thought of it that way. You are right.

@bilal-fazlani

bilal-fazlani Feb 3, 2017

Never really thought of it that way. You are right.

@daveaglick daveaglick referenced this pull request in Wyamio/Wyam Feb 12, 2017

Merged

WIP: Adds basic support for LiveReload when watching/previewing #420

5 of 5 tasks complete
@darkl

This comment has been minimized.

Show comment
Hide comment
@darkl

darkl Apr 27, 2018

Collaborator

Not needed anymore.

Collaborator

darkl commented Apr 27, 2018

Not needed anymore.

@darkl darkl closed this Apr 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment