Comments (5)
I haven't tried to install on windows. I'll poke at that tonight and see what I can do.
I think I have windows somewhere ...
-dave
On Mar 29, 2012, at 8:48 PM, Guillermo [email protected] wrote:
Captain we've been hit!
Tried to install.
go get github.com/ngmoco/falcore
And got:
# github.com/ngmoco/falcore C:\Go\src\pkg\github.com\ngmoco\falcore\server.go:68: cannot use int(srv.listenerFile.Fd()) (type int) as type syscall.Handle in function argument
Windows amd64 Go 1
Reply to this email directly or view it on GitHub:
#4
from falcore.
Thanx Dave. Is not like I'm expecting a fix soon, I just happened to be on
Windows when I saw the announce and tried to installed it and, well, that
happens. It's pretty nice you're working on doing falcore platform
independent.
On Thu, Mar 29, 2012 at 9:52 PM, Dave Grijalva <
[email protected]
wrote:
I haven't tried to install on windows. I'll poke at that tonight and see
what I can do.I think I have windows somewhere ...
-dave
On Mar 29, 2012, at 8:48 PM, Guillermo [email protected]
wrote:Captain we've been hit!
Tried to install.
go get github.com/ngmoco/falcore
And got:
# github.com/ngmoco/falcore C:\Go\src\pkg\github.com\ngmoco\falcore\server.go:68: cannot use int(srv.listenerFile.Fd()) (type int) as type syscall.Handle in function argument
Windows amd64 Go 1
Reply to this email directly or view it on GitHub:
#4
Reply to this email directly or view it on GitHub:
#4 (comment)
"No le digas a Dios lo grande de tu tormenta, mejor dile a tu tormenta lo
grande de tu Dios."
from falcore.
I don't know how safely I can fix this one. I haven't programmed for Windows in year. Anyone have a patch?
@smw1218 I can't remember the reason we needed the listener to be non-blocking. I think it might not be necessary with the new timeout behavior in go1.
from falcore.
Testing indicates syscall.SetNonblock is still required for hot restart.
The Issue:
syscall.SetNonblock is defined on windows, but it requires syscall.Handle instead of int. syscall.Handle is only available on windows. It's basically impossible to get that call to compile without supplying different code per platform. Luckily, all the nonblock stuff is only really needed for the hot restart functionality. Since that relies on fork, we can't use it on windows anyway.
The Fix:
I gave up on using server_$GOOS.go files since I couldn't figure that out nor find adequate documentation. Instead, I use the reflect package to call syscall.SetNonblock only if the runtime version expects an int as the first argument. That allowed everything to compile, but the server still wouldn't start on windows. Turns out asking a socket for it's descriptor on windows returns an error. We didn't need that anyway, so I just wrapped the whole section in a condition on runtime.GOOS.
The Result:
Hot restart still works on supported OSs. Falcore servers run on Windows minus the hot restart behavior. Windows users of the world owe Dave a beer.
from falcore.
Looks like I'm late to the party. Thanks Dave for rocking this! As far as hot restart goes, it looks like there would have to be some good cooperation from the go libs to support it:
If someone really needs the hot restart on windows, I'll find some time to look into it.
from falcore.
Related Issues (20)
- Clean up Router API, document, and provide examples HOT 11
- Graceful shutdown and client keep-alive HOT 3
- Do you have an example for adding a cookie to the response? HOT 2
- SimpleResponse and other response helpers HOT 3
- attach falcore to a running http server HOT 2
- Failing file_filter_test.go HOT 3
- Intermittent failure of static_file/file_filter_test.go: TestBasicFiles HOT 4
- Refactoring for benchmarks and testing. HOT 9
- Keep-Alive causing long delays HOT 16
- Nested pipelines report invalid times HOT 1
- Still maintained? HOT 3
- Upstream deadline does not work correctly HOT 2
- Falcore doesn't support Expect: 100-continue requests HOT 7
- Keep-Alive is not working HOT 8
- Responders in subpackage HOT 3
- hot restart usage? HOT 11
- basic_file_server example compilation fails HOT 2
- Extracting parameters from request HOT 4
- Can this be used along with the Gorilla toolkit? HOT 3
- url blog
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from falcore.