Well I mean in the server I did not use much libdispatch - a "one thread per object" model is used - CGIListener objects (which maintains a open socket for listening) have a couple of threads each running constantly open, implemented as simple -[NSObject performSelectorInBackground:withObject:], and CGIConnection objects that maintains a client session used that too. However libdispatch is used in WebUIKit.
在 2013-5-17,上午9:06,Steve Wart <[email protected]> 写道: > What do you mean by Berkeley sockets? It's my understanding that libdispatch > uses kqueue() under the covers on FreeBSD and OS X, and I assume the Linux > port is using epoll(). It seems that these APIs have obviated the use of > accept() or select() these days, and libdispatch makes for much less > convoluted code. > > Even though it's about signal handling and not sockets, I found this article > to be very helpful in understanding what's going on with kqueue() -- > http://www.mikeash.com/pyblog/friday-qa-2011-04-01-signal-handling.html > > > On Thu, May 16, 2013 at 5:54 PM, Maxthon Chan <[email protected]> wrote: > If you are interested in this, we can do that together, use 100% Objective-C > to finish that (that is, I will be manipulating Berkeley sockets myself, in > CGIListener and CGIConnection classes, without minding the run loop hence > without using any CF. This CGI class prefix is inherited from my first > attempt of implementing a CGI application framework that runs on top of > Apache 2.2). I have some previous experience hand-writing a HTTP > implementation out of Objective-C so a server will not be a major problem. > > And from the IIS design that I took as a reference (the IIS design in > question is what Microsoft built into their .net framework, used by their IIS > version 7 and up, development servers, as well as ported and used by Mono in > mod_mono for Apache 2.2 as well as the xsp server) I used a very generic > design - by properly implementing the CGIHandler you can essentially use > ohttpd to host any protocol that is based on HTTP - an extreme example is (on > OS X) couple ohttpd with Apple's AVFoundation to provide very powerful > multimedia streaming (as the server, the module and the multimedia API are > all written in the same language and are linked/loaded into the same memory > space). > > 在 2013-5-17,上午8:39,Steve Wart <[email protected]> 写道: > >> Older web frameworks are based on a different model of HTML generation than >> you see in modern web applications, which make heavy use of XMLHttpRequest >> and JavaScript on the client to dynamically construct the DOM, rather than >> generating it on the server. >> >> I've been playing a bit with Node.js and Nginx lately and I have to say I >> really like the philosophy behind these systems. A single-threaded model has >> its limitations however, and Objective-C has a few features that could >> really shine for a modern Node-like application server using asynchronous >> blocks and libdispatch. >> >> Serving up HTML from a web app doesn't interest me in particular, but I am >> interested in what you are doing. The WebSockets spec has been finalized and >> it is well-supported on modern web browsers and mobile devices. I had a look >> at porting SocketRocket (https://github.com/square/SocketRocket) to GNUStep >> and/or Etoile, but I didn't want to deal with porting all the CF >> dependencies, so I decided to use Node.js instead. >> >> If anyone is interested in these sorts of features, I would be happy to help >> work on them. A full HTTP server is a very complex piece of software, but >> the SocketRocket code base is small. I think an Objective-C application >> server sitting behind an Nginx proxy would be ideal for many projects, and >> the scope is much smaller than supporting the full HTTP specification. >> >> Steve >> >> >> On Thu, May 16, 2013 at 4:28 PM, Chan Maxthon <[email protected]> wrote: >> Well that thing never compiled for me, using trunk libobjc2 and trunk >> llvm/clang on my server, let alone I have portability in mind (Written under >> OS X, it is required to build on Linux as well, using trunk libobjc2, trunk >> llvm/clang and full Objective-C ARC.). And the reason I spawned this project >> is not only make a server, but also make using it easier. WebUIKit mimics >> iOS UIKit in behavior, very closely. (hence the namesake) To the extent that >> I will even create a way to write pages with embedded WebUIKit objects just >> like xibs. >> >> 发自我的 iPad >> >> 在 2013-5-17,6:25,Lars Sonchocky-Helldorf >> <[email protected]> 写道: >> >> > >> > Am 16.05.2013 um 21:50 schrieb Maxthon Chan: >> > >> >> Well it turned out that my darned project is forced into using >> >> CoreFoundation (I need CFRunLoop to manage some BSD sockets' lifetime, as >> >> it is a portable HTTP server written in Objective-C.) >> >> >> >> If I recalled right, the first HTTP stack is written in Objective-C, on a >> >> NeXT box. >> >> >> >> I have some web development experienced with ASP.net (as my current >> >> website homepage is written in C# hosted on a Linux server using Mono) >> >> while the web development suite for Objective-C, an equally powerful >> >> language as C#, is pretty much dead. >> >> >> >> I analysed and discovered that in order to get the most out of ASP.net, >> >> Microsoft written their IIS in .net (version 7 up, I have a copy of >> >> Windows Server 2012 as a secondary OS on my MacBook Pro and the IIS 8 >> >> shipped with it is pretty much all .net). >> >> >> >> This lead me to think: can I write an equally powerful HTTP server in an >> >> equally powerful language, Objective-C, given its significance in the >> >> history of World Wide Web. >> >> >> >> And since the Objective-C language have improved vastly over decades, can >> >> I implement something similar to ASP.net, hosted on this server which is >> >> itself written in Objective-C? >> > >> > Have you ever heard of WebObjects? WebObjects was started by NeXT in 1995 >> > and is an object oriented web framework originally written in ObjC (up to >> > version 4.5) but nowadays in Java (up to version 5.4.3) While still in use >> > at Apple internally (for the iTunes Store for instance) the last public >> > release was in 2008 and it has been deprecated by Apple. Never the less it >> > is still one of the most advanced web frameworks out there. Nowadays it is >> > still in use in several companies (like the one I work for) and has been >> > extended by a community driven effort (Project WOnder). >> > >> > And now the best part: There is an free software clone of WebObjects 4.5 >> > available. It is called GNUstepWeb. Get it here: >> > >> > http://wiki.gnustep.org/index.php/GNUstepWeb >> > http://svn.gna.org/svn/gnustep/libs/gsweb/trunk/ >> > >> > The documentation is still available at Apple: >> > >> > http://developer.apple.com/legacy/library/#documentation/LegacyTechnologies/WebObjects/WebObjects_4.5/webobjects.html#//apple_ref/doc/uid/TP40006775 >> > >> > cheers, >> > >> > Lars >> >> _______________________________________________ >> Etoile-discuss mailing list >> [email protected] >> https://mail.gna.org/listinfo/etoile-discuss >> >> _______________________________________________ >> Etoile-discuss mailing list >> [email protected] >> https://mail.gna.org/listinfo/etoile-discuss > > > _______________________________________________ > Etoile-discuss mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-discuss > > > _______________________________________________ > Etoile-discuss mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-discuss
_______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
