1

I want to use this library for cross platform networking.

http://lacewing-project.org/

It works with OSX, Linux, Windows and has specific code for Android. What I do not know is if it will work (as a client) on iOS. (meaning I will not host a server on iOS)

Since it uses POSIX sockets internally does that make it compatible with iOS?

Thanks

James M
  • 18,506
  • 3
  • 48
  • 56
jmasterx
  • 52,639
  • 96
  • 311
  • 557

3 Answers3

0

Without trying it, my guess would be that it would work. You will need to write your UI in Objective-C, but you should be able to use Objective-C++ to bind your libraries to the UI. Before you start into the Objective-C++ path be aware of the limitations (see: How well is Objective-C++ supported?).

Community
  • 1
  • 1
Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117
  • I'm already using a C library that is for my game graphics and all.. I will not be making UI code in Obj-C. The C graphics library Allegro 5 does it all for me. I just need to be able to have the client talk to the server. – jmasterx May 14 '12 at 16:04
  • Good to hear. I just assumed that you would be using Cocoa for UI because that's what most people do. You should be all set. – Jeffery Thomas May 14 '12 at 16:36
0

I would try using the objective-c library AFNetworking first, from the creators of gowalla.

You can get it here: https://github.com/AFNetworking/AFNetworking

On the topic of lacewing, it should work fine, as long as it relies upon the BSD sockets API, as I can confirm that it exists on iOS.

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
-2

If it's only written in C/C++ then no, unless you got a C/C++ SDK for iOS (which AFAIK does not exist publicly). iOS SDK is for Objective-C.

m0skit0
  • 25,268
  • 11
  • 79
  • 127
  • 1
    I think you mean there are no Cocoa bindings for C++. There is a C++ SDK for iOS. It's a part of Xcode. – Jeffery Thomas May 14 '12 at 15:56
  • 1
    Objective-C is a strict superset of C. So, any pure C library should work. Additionally, the compiler supports Objective-C++, which allows you to mix Objective-C and C++ – Dirk May 14 '12 at 15:57
  • @Dirk So if the library works on Linux and OSX without any OSX specific code, it should work on iOS? The library is pure C, but has a binding for C++. – jmasterx May 14 '12 at 15:59
  • @JefferyThomas C++ is NOT a part of Xcode, it is a part of GCC, which is what LLVM is based on, which is the default compiler that Xcode uses. – Richard J. Ross III May 14 '12 at 16:02
  • @Milo: Not necessarily. The system calls might not be available, etc. But the language is not the barrier here. That's all I wanted to say. – Dirk May 14 '12 at 16:02
  • @RichardJ.RossIII, I guess I should have said "It's shipped with Xcode", but I do believe there is no current version of Xcode which does not include a C++ compiler. – Jeffery Thomas May 14 '12 at 16:41