On 26/08/13 8:43 PM, David Chisnall wrote:
On 26 Aug 2013, at 09:29, Stephen Woolerton <[email protected]> wrote:
I put some sample code up at
http://artinamessage.wordpress.com/2013/08/26/sockets-libdispatch-and-gnustep/
A simple networked client and server using GNUstep and libdispatch on FreeBSD.
You could probably simplify the code a lot by using NSFileHandle to set up the
socket and then just get the fd that it returns. GNUstep has some helper
methods in GNUstepBase that make this easier.
David
I'd be interested to see such methods. I did hunt around for
implementation of networking methods in GNUstepBase however I could only
find method stubs - no implementation. Then I found ETSocket in EToile,
and extracted that class and got it working in gnustep-base sans SSL. I
was doing this for a Raspberry Pi install, where there is GNUstep, but
no libdispatch.
While we're on the subject, I found Apple advising not to use
NSFileHandle for sockets...
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/CommonPitfalls/CommonPitfalls.html
and the section titled "Do Not Use NSSocketPort (OS X) or NSFileHandle
for General Socket Communication".
However, so far as GNUstep and ETSocket are concerned, it seems to me
that NSFileHandle is connected to standard POSIX sockets and so there
should be no issue.
Regards
Stephen
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep