Sending TCP commands

I have functioning Xojo app for the OSX desktop and I want to make version for the ipad. The application send remote control commands to a media server via TCP. I do not see any info on doing this in Xojo on the iPad currently. I assume I am just not seeing it (as normal for me), can someone point me in the right direction if it is available?

THanks
JMW

Xojo.Net.TCPSocket

Hmm, seems to be very little info there on it, granted my limited experience. I am used to dropping the TCPSocket class on the frame and then configuring and opening it. I am guessing it is a Class and I kinda have to do a few more things to getting it going on the iPad. Not as simple as I had hoped… I will keep reading and poking at it.

Thank You,
JMW

If you know a bit about TCP – which you should to be able to use it – there is enough info.

This is possible in desktop projects, but in an iOS project it is slightly different.

Please read the reference page – this is how it starts:

TCPSocket
This class is used for TCP/IP communication.

Item Summary
Name Xojo.Net.TCPSocket
Type Class <–––––

So no guessing necessary.

Maybe I am missing something here. I do not see the the normal TCPSocket item in the iOS library…

THX
JMW

Sorry, but I think there is enough documentation and examples.

  • Menu Insert/Class

  • Set the super of the class to Xojo.Net.TCPSocket

  • Drag an instance of that class to a view

  • Proceed as you would in Desktop.

Make sure to read carefully the LR, there are differences with the classic desktop control.

Thank you Michael, this is a big help! Exactly the instructions I needed.

LR?

JMW

Language Reference. Here : http://developer.xojo.com/xojo-net-tcpsocket

Copy

THX
JMW

[quote=282628:@Michel Bujardet]- Menu Insert/Class

  • Set the super of the class to Xojo.Net.TCPSocket

  • Drag an instance of that class to a view

  • Proceed as you would in Desktop.

Make sure to read carefully the LR, there are differences with the classic desktop control.[/quote]
Really? No offense, but why create a subclass? Drag a “Generic Object” from the Library to the View and set its class – I still don’t know why this text field is labelled “Super” – to “Xojo.Net.TCPSocket”.

That is another way. Thanks.

Dropping an object onto the UI editor creates an automatic subclass of the "Super"class.

No, it does not. It creates an instance of the class. It should be labelled “Class” and not “Super”.

Yes it does, unless Xojo handles it differently from RS.

Proof: drop a TCPSocket on a window then run this code:

If TCPSocket1 IsA Window1.TCPSocket1 Then  // IsA detects classes, not instances
   MsgBox("Automatic subclass of TCPSocket")
End If

There is no difference in that regard between Xojo and RS.

[quote=282654:@Andrew Lambert]If TCPSocket1 IsA Window1.TCPSocket1 Then // IsA detects classes, not instances
MsgBox(“Automatic subclass of TCPSocket”)
End If[/quote]
This code will not compile.

Compiles and runs for me just fine on RS2011r4.3.

Strange, it indeed works with RS – but not with Xojo – for TCPSocket. It does not compile for regular controls (like Label, which I mentioned above) in RS and Xojo.

This is what is going on I think: introspection shows that a wrapper is needed for a non-RectControl subclass to act as control in the window editor. In RS this wrapper was exposed to the IsA operator, in Xojo it is not exposed to IsA.

In Xojo the wrapper is a class called Window1._wrapper_TCPSocket1. In RS it was called Window1.TCPSocket1.