Re: Modern server socket programming?

2013-01-09 Thread Marcus Müller
On 09.01.2013, at 11:17, David Chisnall thera...@sucs.org wrote: P.S. I keep pondering adding a kqueue back end for the GSRunLoop stuff, which would be a lot more scalable, but I've never heard of anyone adding enough file descriptors to a run loop for this to matter. I certainly have no

Re: Modern server socket programming?

2013-01-09 Thread Marcus Müller
On 08.01.2013, at 18:45, Richard Frith-Macdonald rich...@tiptree.demon.co.uk wrote: I don't have any demo/example code for a server, but to show it, I chopped out the key bits of a larger program: PS. using a server socket is exactly like using a client NSStream with the exception of

Re: Modern server socket programming?

2013-01-09 Thread Stefan Bidi
As the GNUstep corebase maintainer, of be very interested in hearing what has and has not worked for you. The project is to be considered experimental, at best, but there are still a few useful features. Concerning the uuid issue you had. Could you provide me an example of what avahi does accept?

Re: Modern server socket programming?

2013-01-09 Thread Marcus Müller
Hi Stefan, As the GNUstep corebase maintainer, of be very interested in hearing what has and has not worked for you. the obvious (and probably biggest) thing missing is ARC support. As I already mentioned this poses a problem in ARC-ready code which drags in corebase headers via other

Re: Modern server socket programming?

2013-01-09 Thread Stefan Bidi
ARC is still kind of a foreign concept to me. I've had some conversations with David about it, but I don't remember if I ever implemented some of his recommendations. As for the uuid thing, it might be a problem with the toll-free bridge mechanism. I've also started doing some work in CFString

Re: Modern server socket programming?

2013-01-09 Thread Marcus Müller
Hi, ARC is still kind of a foreign concept to me. I've had some conversations with David about it, but I don't remember if I ever implemented some of his recommendations. to me that's understandable. I've never seen the point in ARC, too - until we switched a rather huge codebase to ARC.

Re: Modern server socket programming?

2013-01-09 Thread David Chisnall
On 9 Jan 2013, at 16:47, Marcus Müller wrote: to me that's understandable. I've never seen the point in ARC, too - until we switched a rather huge codebase to ARC. The increase in readability and clarity was extremely significant. Also, robustness increased dramatically. I was probably the

Modern server socket programming?

2013-01-08 Thread Marcus Müller
Hi all, I've just started to port a rather tiny Bonjour-service based server application from OSX to GNUstep (running on FreeBSD 9.1). Because this is a new-school ObjC 2.0 ARC based project, I've also installed all prerequisites for doing that: brand new clang, libobjc2. Everything works as

Re: Modern server socket programming?

2013-01-08 Thread David Chisnall
Hi Marcus, The easiest way of scheduling a socket in the run loop is to remember that sockets are just file descriptors and so can be wrapped in an NSFileHandle and connected to a notification. This is easy from anything that allows you to get the underlying file descriptor for the socket,

Re: Modern server socket programming?

2013-01-08 Thread Chan Maxthon
You can mix ARC and non-ARC code, given that those code are placed in separate files, then link them together. So you can safely implement the missing link in ARC code using Objective-C categories, and link them together with non-ARC GNUstep and your project in ARC. 发自我的 iPad 在

Re: Modern server socket programming?

2013-01-08 Thread Marcus Müller
On 08.01.2013, at 18:02, Chan Maxthon xcvi...@me.com wrote: You can mix ARC and non-ARC code, given that those code are placed in separate files, then link them together. So you can safely implement the missing link in ARC code using Objective-C categories, and link them together with

Re: Modern server socket programming?

2013-01-08 Thread Marcus Müller
On 08.01.2013, at 18:00, David Chisnall thera...@sucs.org wrote: Hi Marcus, The easiest way of scheduling a socket in the run loop is to remember that sockets are just file descriptors and so can be wrapped in an NSFileHandle and connected to a notification. I don't understand what you

Re: Modern server socket programming?

2013-01-08 Thread Chan Maxthon
In this circumstance, I would replace GNUstep with Apple's CoreFoundation (it's open, despite branded with Apple) and lay Cocotron on it, then use GNUstep to provide everything that is missing. Cocotron is an implementation of Foundation (GNUstep Base) using open sourced code and based on

Re: Modern server socket programming?

2013-01-08 Thread Marcus Müller
Hi Chan, In this circumstance, I would replace GNUstep with Apple's CoreFoundation (it's open, despite branded with Apple) and lay Cocotron on it, then use GNUstep to provide everything that is missing. Cocotron is an implementation of Foundation (GNUstep Base) using open sourced code and

Re: Modern server socket programming?

2013-01-08 Thread Richard Frith-Macdonald
On 8 Jan 2013, at 16:55, Marcus Müller wrote: SOLUTION? == Searching for alternatives I've stumbled across GSSocketServerStream (GSInetServerStream, …) which seems to be something that I could use, but haven't found any code demonstrating how to use it. Does anybody have any

Re: Modern server socket programming?

2013-01-08 Thread Marcus Müller
On 08.01.2013, at 18:38, Richard Frith-Macdonald rich...@tiptree.demon.co.uk wrote: Look at the code in gnustep-base (NSURLProtocol.m) for an example of using the NSStream based stuff to make an HTTP (or HTTPS) request to a remote system. I don't have any demo/example code for a server,

Re: Modern server socket programming?

2013-01-08 Thread Richard Frith-Macdonald
On 8 Jan 2013, at 17:38, Richard Frith-Macdonald wrote: On 8 Jan 2013, at 16:55, Marcus Müller wrote: SOLUTION? == Searching for alternatives I've stumbled across GSSocketServerStream (GSInetServerStream, …) which seems to be something that I could use, but haven't found

Re: Modern server socket programming?

2013-01-08 Thread Ivan Vučica
8. 1. 2013., u 18:19, Marcus Müller z...@mulle-kybernetik.com je napisao: I don't understand what you mean by connected to a notification. David is, if I understand correctly, referring to using methods such as -[NSFileHandle acceptConnectionInBackgroundAndNotify] after creating the file

Re: Modern server socket programming?

2013-01-08 Thread Marcus Müller
Hi Ivan, I don't understand what you mean by connected to a notification. David is, if I understand correctly, referring to using methods such as -[NSFileHandle acceptConnectionInBackgroundAndNotify] after creating the file handle with -[NSFileHandle