gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Modern" server socket programming?


From: Richard Frith-Macdonald
Subject: Re: "Modern" server socket programming?
Date: Tue, 8 Jan 2013 17:45:27 +0000

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 any code demonstrating how to use it. Does anybody have any 
>> demo code/project as a starting point?
> 
> 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, 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 two method calls:
1. to create the listening stream/socket
2. to accept an incoming connection (when the listening socket is readable), 
creating new in/out streams
This is a direct reflection of the way standard unix/bsd sockets worK, so if 
you know unix socket programming (or cocoa streams programming) it should be 
really easy.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]