Mac Networking and macCarbNet.cc
by William Taysom · in Torque Game Engine · 05/27/2004 (12:41 am) · 14 replies
Let me start by saying I just got Torque at the beggining of the week, so I'm still getting my bearings. But I know exaclty I'm looking to do and includes cross platform TCP connectivity. TCPObject is perfect for my needs. So, I started with it immediately.
TCPObject didn't work for me. I found the problem was in "macCarbNet.cc" or the lack thereof. I suspect have the version or something because the code in that file needs, euphemistically speaking, a little polish. If I do indeed have the correct version, mine contains this comment on line 867:
// dhc - 9.01 - minor tweaks to try and get this dns crap running again. BUT NOT REALLY ERROR CHECKING!!!!!TBD
then I have a bug fix to submit. I excised the so called "crap" meaning the entire file and replaced it with an minor addaption of "x86UNIXNet.cc". Where does one submit fixes?
Cheers,
WT
TCPObject didn't work for me. I found the problem was in "macCarbNet.cc" or the lack thereof. I suspect have the version or something because the code in that file needs, euphemistically speaking, a little polish. If I do indeed have the correct version, mine contains this comment on line 867:
// dhc - 9.01 - minor tweaks to try and get this dns crap running again. BUT NOT REALLY ERROR CHECKING!!!!!TBD
then I have a bug fix to submit. I excised the so called "crap" meaning the entire file and replaced it with an minor addaption of "x86UNIXNet.cc". Where does one submit fixes?
Cheers,
WT
#2
05/27/2004 (2:27 pm)
It does work. I haven't put together a test suite or the like. But I expect it to work exactly as well as the UNIX code. (They are essentially identical.)
#3
I did not make a patch because frankly the complexity of offering one is lordly.
I would have screwed it up.
tone
06/24/2004 (11:53 am)
I had the same experience, and made the same choice you did, apparently.I did not make a patch because frankly the complexity of offering one is lordly.
I would have screwed it up.
tone
#4
Simply hangs the Mac client, letting it idle endlessly--there is no connection attempt (server side monitored), Windows and Linux clients connect with no problem whatsoever.
The echo statement happens, but the AccountConnection.connect never does.
11/23/2004 (6:45 am)
@All, especially GG: Was this patch/fix ever sent to GG? We are currently attempting to get TCPObjects working for Mac as well, and it basically does nothing.function AccountConnect(%server, %port)
{
if(!$AccountConnected)
{
%address = %server @ ":" @ %port;
echo ("Connect to " @ %address);
new TCPObject (AccountConnection);
AccountConnection.connect(%address);
}
}Simply hangs the Mac client, letting it idle endlessly--there is no connection attempt (server side monitored), Windows and Linux clients connect with no problem whatsoever.
The echo statement happens, but the AccountConnection.connect never does.
#5
William sent me the file (thanks!) and it's now checked in, along with the appropriate project file changes. This change will exist in the next TGE SDK Installer as well.
11/23/2004 (4:10 pm)
I'll double-check, and if not will have it committed this evening.William sent me the file (thanks!) and it's now checked in, along with the appropriate project file changes. This change will exist in the next TGE SDK Installer as well.
#6
#include
(Error : the file could not be opened.)
from the file platform/platformNetAsync.h, which is included by MacCarbNet.cc.
I searched for pthread.h on my entire harddisk, and there is no file by that name present.
I'm running on OS 10.3.6, under codewarrior.
Does anyone know what I am missing?
11/24/2004 (1:13 pm)
I just included this fix from HEAD, and I am getting a compile Error for the line:#include
(Error : the file could not be opened.)
from the file platform/platformNetAsync.h, which is included by MacCarbNet.cc.
I searched for pthread.h on my entire harddisk, and there is no file by that name present.
I'm running on OS 10.3.6, under codewarrior.
Does anyone know what I am missing?
#7
Not sure what's going on there. Again, pthread.h is a system-provided header, standard as of OS X 10.2, so I can only imagine that it's some configuration-specific issue.
11/26/2004 (8:03 pm)
I'm at home so I don't have my Mac handy, but pthread is a system file. It should be included somewhere in your usr dir as of OS X 10.2 If you haven't done so already, you might need to install the XCode dev tools, maybe it's installed there. With 10.3, XCode is free, so even if you prefer not to use XCode you might want to install the dev tools and try again. Note though that XCode is the only Mac compiler we officially support.Not sure what's going on there. Again, pthread.h is a system-provided header, standard as of OS X 10.2, so I can only imagine that it's some configuration-specific issue.
#8
I installed the XCode Tools this morning, and I still don't see the pthread.h file anywhere on my harddisk. I'll check and see if I can tell what I am missing.
11/29/2004 (9:07 am)
@josh,I installed the XCode Tools this morning, and I still don't see the pthread.h file anywhere on my harddisk. I'll check and see if I can tell what I am missing.
#9
Not sure why pthread.h would still be missing after installing the dev tools...
the file, on my system ( 10.3.6, Xcode 1.5 ) is @
/usr/include/pthread.h
the installer that contains it is pre-installed @
/Applications/Installers/Developer Tools/Packages/DevSDK.pkg
11/29/2004 (9:57 am)
Steve, did you install the BSD subsystem & the BSD sdk?Not sure why pthread.h would still be missing after installing the dev tools...
the file, on my system ( 10.3.6, Xcode 1.5 ) is @
/usr/include/pthread.h
the installer that contains it is pre-installed @
/Applications/Installers/Developer Tools/Packages/DevSDK.pkg
#10
11/30/2004 (8:58 am)
Just for the information of anyone else in the same position as myself, I finally found pthread.h. It is not installed when you just installed the xCode Tools cd, instead you have to go into the packages folder, and install the MacOSX10.1.pkg. I guess this is an older package that is not installed by default.
#11
We're still having problems with ghostAlways objects, but we think it's due to a missing file or two in our Xcode project targets.
Thanks for getting the fixes in Josh!
11/30/2004 (8:59 am)
Cleanup here as well: The version that Josh checked in to CVS fixed our problem regarding the TCPObject.We're still having problems with ghostAlways objects, but we think it's due to a missing file or two in our Xcode project targets.
Thanks for getting the fixes in Josh!
#12
11/30/2004 (9:54 am)
After finding pthread.h, I found that there were numerous other header file problems with the way this file is setup. I realize that Codewarrior is not officially being supported anymore, but I'm afraid we are commited to it. I think I'm going to have to revert to the previous version of this file. Does anyone know if this has any bigger impact then just not being able to use the TCPObject?
#13
11/30/2004 (3:14 pm)
Steve, that's the only impact I'm aware of. The new code that William provided is nicer in general, but the only real tangible effect I can think of is the use of the TCPObject.
#14
thanks for the response. We will revert to the previous version of the file, as I don't expect to need TCPObject.
11/30/2004 (3:27 pm)
Josh,thanks for the response. We will revert to the previous version of the file, as I don't expect to need TCPObject.
Associate Kyle Carter
If so, mail the fix to Josh Williams at joshw@garagegames.comm