GLBasic forum

Main forum => FAQ => Topic started by: spicypixel on 2011-May-10

Title: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
I have written a PC app which is my server (configured port forwarding etc..) and an iPhone app which when testing in GLB works perfectly for both local LAN IP and Remote IP (handled by port forwarding). Both of these work and messages can be sent successfully to the PC server.

However...

Now that I have the GLB app running on my iPhone neither on Wifi or 3GS can I get it to work. In fact on Wifi it doesn't connect but on 3G regardless of both IP and PORT entered it always connects (when in fact it isn't it just says it has??).

Anyone have any ideas? This was hoping to be my first commercial app so I'm happy to privately post source and the Win exe server to show it working and if they can give some indication as to why it won't work on the device I'd be most grateful. It does seem I'm asking for loads of help but I'm new to GLB and given that the app and server work on the PC I'm a little befuddled.

=)
Title: Re: TCP on iPhone device seems strange
Post by: Kitty Hello on 2011-May-10
Oh no!
Please view the debug log if it says something special when the error happens. Also make sure you >>STDOUT NETGETLASTERROR$()+"\n"<< after every command to see where and why it fails.

Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
It works when I run the client on the PC just not on the iPhone so I'm not sure how I'd be able to get any particular ERRORS. I will add a PRINT statement within my code to view NETGETLASTERROR$() and also the status of the SOCK_INIT() variable and such. I didn't realise there was a sleep command so in addition to the timeout value within the TCP connection I'm now adding the sleep command for timeout plus half-second to allow for multi-tasking if that is the problem.

Code (glbasic) Select

socket = SOCK_TCPCONNECT(ip_address$, ip_port, timeout)
SLEEP (timeout + 500)


Next test with additional debugging.... =)
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
Yep the SLEEP command did the trick. Time for some hardcore testing on the device now to ensure stability ;)
Oh yeh before I forget it compiled and uploaded to the iPhone correctly but I got some deprecated errors (app still ran though) is this normal?

there were 95 errors duplicated twice giving 190 deprecated errors shown here... I only put the arm7 as arm6 were duplicated...

Code (glbasic) Select

Build iPhone of project iPhone with configuration Release

Check dependencies

[WARN]Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'iPhone-Info.plist'.

Ld build/iPhone.build/Release-iphoneos/iPhone.build/Objects-normal/armv7/RemoteShutdown normal armv7
cd "/Volumes/Storage/iPhone Projects/RemoteShutdown"
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk "-L/Volumes/Storage/iPhone Projects/RemoteShutdown/build/Release-iphoneos" "-L/Volumes/Storage/iPhone Projects/RemoteShutdown/Lib" "-F/Volumes/Storage/iPhone Projects/RemoteShutdown/build/Release-iphoneos" -filelist "/Volumes/Storage/iPhone Projects/RemoteShutdown/build/iPhone.build/Release-iphoneos/iPhone.build/Objects-normal/armv7/RemoteShutdown.LinkFileList" -dead_strip -lstdc++ -miphoneos-version-min=3.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework CoreLocation -framework OpenAL -lGLBasiciPhone-egl -lpng-gf -lPROGRAM -framework MediaPlayer -o "/Volumes/Storage/iPhone Projects/RemoteShutdown/build/iPhone.build/Release-iphoneos/iPhone.build/Objects-normal/armv7/RemoteShutdown"

ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(iPhoneAppController.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(iPhoneMain.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(iPhoneEAGLView.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(glb-full.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(glb_pc.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libPROGRAM.a(gpc_temp0.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libPROGRAM.a(gpc_tempg.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(astarplanner.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(planner.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(GFCompression.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(OpenGLRainbows.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(gf_sockets.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(blowfish.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(fbuffers.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(Rainbows3D.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(htmutex.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(hthread.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(DXSound.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(DXInput.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(glb3D.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(nodehashtable.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(nodehashtable-iterator.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(node.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(MeshObject.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(3DMath.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(gf_png.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(gf_jpg.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngset.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngwrite.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngread.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngrtran.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngrio.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngerror.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngmem.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngtrans.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngwio.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(png.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jerror.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcapistd.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcapimin.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdatadst.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdapimin.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdapistd.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcparam.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdatasrc.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libGLBasiciPhone-egl.a(iPhoneSoundEngine.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(inflate.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(crc32.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngrutil.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngget.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngwutil.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(pngwtran.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(deflate.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcomapi.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdmarker.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdinput.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdmaster.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jmemmgr.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcmarker.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcinit.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcprepct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcmainct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcsample.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcphuff.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jchuff.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jccolor.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcmaster.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jcdctmgr.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jccoefct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jutils.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jquant2.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdphuff.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jquant1.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdcoefct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdsample.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdcolor.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdmainct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdhuff.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdmerge.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jddctmgr.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jdpostct.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jmemnobs.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(trees.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(zutil.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(compress.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(inffast.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(inftrees.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(adler32.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jfdctflt.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jfdctfst.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jfdctint.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jidctred.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jidctint.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jidctflt.o)
ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: /Volumes/Storage/iPhone Projects/RemoteShutdown/Lib/libpng-gf.a(jidctfst.o)



Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
GLBASIC is awesome!!! =) Will purchase this on Monday woohoo!!!!
Title: Re: TCP on iPhone device seems strange
Post by: Ian Price on 2011-May-10
Quote from: Ocean on 2011-May-10
Quote from: spicypixel on 2011-May-10
GLBASIC is awesome!!! =) Will purchase this on Monday woohoo!!!!

don't put off till Monday what you can do on the previous Wednesday...  :|

Those are wise words indeed =D
Title: Re: TCP on iPhone device seems strange
Post by: trucidare on 2011-May-10
these are warnings from new gcc compiler apple is using in xcode 4.
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
Quote from: Ocean on 2011-May-10
Quote from: spicypixel on 2011-May-10
GLBASIC is awesome!!! =) Will purchase this on Monday woohoo!!!!

don't put off till Monday what you can do on the previous Wednesday...  :|

Strangely enough I decided I'm gonna purchase it this evening when I get back from my rib eye steak meal =)
Title: Re: TCP on iPhone device seems strange
Post by: msx on 2011-May-10
I advise you to use Xcode 3.2.5 SDK 4.2. I've had those errors too, and Apple Rejected my application.
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
Quote from: msx on 2011-May-10
I advise you to use Xcode 3.2.5 SDK 4.2. I've had those errors too, and Apple Rejected my application.

Ouch! I've got 3.2.6 at the moment so hopefully I can install to a previous version? Any pointers happily appreciated ;)
Title: Re: TCP on iPhone device seems strange
Post by: msx on 2011-May-10
No problem!

http://developer.apple.com/ios/download.action?path=/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
Quote from: msx on 2011-May-10
No problem!

http://developer.apple.com/ios/download.action?path=/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg

Downloading now. Am I best letting it install and working itself out or pick a new location? Will it interfere with my dev and dist certificates or will each SDK recognise their existence if I attempt to install to a new location. I'm a real Mac noob only purchasing it for iPhone development as my Hackintosh was farrrrrrr too slow =)
Title: Re: TCP on iPhone device seems strange
Post by: msx on 2011-May-10
Install over the previous version and not worry about anything else.
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-10
Quote from: msx on 2011-May-10
Install over the previous version and not worry about anything else.

Awesome, cheers bud ;)
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-12
This is soooo weird...

I can get my TCP Socket connection to connect on both 3G and WIFI and the app communicates with my server, sending commands happily. The server isn't sending messages back to the client so I know there are no problems of receiving data on the phone as I'm only using SOCK_INIT(), SOCK_TCPCONNECT, SOCK_TCPSEND and SOCK_SHUTDOWN.

The issue I have is that regardless of what IP:PORT I enter into the SOCK_TCPCONNECT, SOCK_INIT() always returns 1 when I initialise it and TCP_CONNECT always returns 0 when I perform the command. So it says connected even though there is no way it is connecting to anything!!

Like I say if I enter the correct IP:PORT for my server then it does also connect, but it never says it has failed with the wrong details....

UBER STUMPED LOL =)

This is my code that I have which as I say works, and produces success and error warnings correctly on the PC just not on the iPhone.

Code (glbasic) Select

IF socket = -1
sinit = SOCK_INIT()
socket = SOCK_TCPCONNECT(ip_address$, ip_port, timeout)
SLEEP (timeout + 500)
IF socket = -1
PLAYSOUND (on_error, 0, 0.9)
connected = FALSE
power = FALSE
msg$ = "Failed to connect" ; px = 138 ; py = 152
sinit = 0
SOCK_SHUTDOWN
ELSE
PLAYSOUND (on_connect, 0, 0.9)
connected = TRUE
power = TRUE
msg$ = "Successful connection" ; px = 112 ; py = 152
ENDIF
ELSE
PLAYSOUND (on_error, 0, 0.9)
connected = TRUE
power = TRUE
msg$ = "Already connected" ; px = 140 ; py = 152
ENDIF
Title: Re: TCP on iPhone device seems strange
Post by: Kitty Hello on 2011-May-12
Code (glbasic) Select

LOCAL socket% = -1 // I assume
sinit = SOCK_INIT() // First time run of the program - initialize the socket engine - DON'T DO THAT SOMEWHERE IN BETWEEN - don't make life complicated


... main program ...

IF NOT sinit THEN END // that can't happen. Really - it's always working

// connect to the server thing
socket = SOCK_TCPCONNECT(ip_address$, ip_port, timeout)
IF socket = -1 // Can't connect? Why?
PLAYSOUND (on_error, 0, 0.9)
connected = FALSE
power = FALSE
msg$ = "Failed to connect" + NETGETLASTERROR$(); px = 138 ; py = 152 // Tell us why!
sinit = 0
SOCK_SHUTDOWN
ELSE
    SOCK_SET_BLOCKING socket%, TRUE // set to blocking mode -> wait for each command to return (might help)
    IF SOCK_TCPSEND(socket%, "Yo mama, sockets like rockets") < 0; msg$=NETGETLASTERROR$(); RETURN FALSE; ENDIF
PLAYSOUND (on_connect, 0, 0.9)
connected = TRUE
power = TRUE
msg$ = "Successful connection" ; px = 112 ; py = 152
ENDIF
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-12
Yo mama, sockets like rockets PMSL =) Thank you Gernot will adapt my code accordingly

SOCK_SET_BLOCKING is not in my manual here, hmmmm update methinks!
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-12
SOCK_SETBLOCKING doesn't exist Gernot????? :O
Title: Re: TCP on iPhone device seems strange
Post by: Kitty Hello on 2011-May-13
get the beta version (android thread) and unzip the hotfix for it afterwards.
The manual is the online help that should show it.
Title: Re: TCP on iPhone device seems strange
Post by: spicypixel on 2011-May-14
I have now tried my app on an iPad and it works flawlessly with both 3G and WiFi connecting when it should and failing when it should. I can only presume on my JB'd iPhone that it has some internal firewall or proxy that re-routes the connections thus allowing the connection to be accepted internally and consequently my app saying "connected" but then obviously re-routing the connection nowhere because it can't unless of course I enter the correct IP and Port in which case the connnected message is indeed correct.

Like I have always said my app works on my JB'd phone too and connects flawlessy if the correct IP:Port is given and performs the commands successfully to the server my only problem was that it say "connected" pretty much regardless of IP:Port (apart from things like 255.255.255.255:port etc..)

I did send a message Gernot to see if you wouldn't mind trying the app of mine on your device to see if it is a JB issue with certain JB'd phones (mine is a white US iPhone 3GS) but I guess you are busy no problem mate and thank you for the help already. =)