Can a control set be created in a Console App?

In looking at the examples for ServerSocket use, they are both UI applications. I want to use ServerSocket to communicate with other computers on the same network.

I’m finding the other computers using AutoDiscovery. As I cannot be sure that one computer is always going to be on and therefore the master, my strategy is that the other computers that are already on the network when I start up will have the TCPSocket initiated by the new device. That will continue to happen when other devices join… the new guy hooks up to all the old ones.

It would seem, then, that I would need a ServerSocket listening, and some other TCPSockets connecting to the existing devices. Here are my questions…

?Sochn!
Gary

[quote=47378:@Gary McGuire]If I need to set up a set of other TCPSockets to be the client, per the example projects, how do I create a TCPSocket set in a console application so that I will have the index as an argument in all of the events?
[/quote]

Ah, someone else has run into something I would love… A non-GUI control set. Right now, you don’t. But it would be wonderful to have such a beast. For now, create a class, add those TCPSockets as properties, instantiate them in the constructor.

You can create an array of TCPSockets although to be useful you’d want to create your own subclass first.

Dim mySocket() AS TCPSocket

mySocket.append New TCPSocket(properties)

As Brad said you’ll want to pass properties through the constructor.

You can achieve this easily with my latest console class. It allows apps to be console, gui, or both at the same time. … or switch between the two at runtime… And data can be exchanged between gui and/or console seamlessly. Is adding the functionality in a class, which everyone asks for, “competing with Xojo”? In this case, wouldn’t creating anything (like web service api classes) be competition? In Xojo it seems that “if the solution is elegant and re-usable” it is “not okay” or raises “hey, that’s cool but we prefer you not provide that as a solution for anyone…Let them suffer out the roadblocks themselves…that’s why we charge for help” (we want your money…not REAL solutions)… even if no EULA is trifled with, and inherent system API’s are used… finding solutions for Yall (community as a whole)…i always get “spanked” by Xojo. I mean, I enjoy helping everyone, and finding the solutions that aren’t “readily available”…but I will have to back away and tend to the other communities after this solution, where REAL stewardship for the community exists. I have helped drive hundreds, if not at least 1000+ new developers to Xojo, almost regrettably (your welcome Xojo). The only money to be made from Xojo lies in creating software for the end user, but if you provide solutions to developers, you have a 50/50 chance of “just wasting your time” when Xojo says "we prefer you not help in this solution, let them suffer; they can empty their wallets and we’ll be glad to help “find a solution”…or they’ll move on to another project and no solution will be found. " Numerous projects I’ve migrated to other cross-platform languages, so the projects don’t get stopped, or hindered in any way shape or form, Xojo just doesn’t get the honor of having “made with xojo” stamped on my final product. This being counter - productive since their name isn’t “getting out there.” When 10,000+ people download my software in a single week and see made with lazarus/c++/or genexus (to name a few)…Xojo is not in their minds at all…just a thought.

[quote=47378:@Gary McGuire]In looking at the examples for ServerSocket use, they are both UI applications. I want to use ServerSocket to communicate with other computers on the same network.

I’m finding the other computers using AutoDiscovery. As I cannot be sure that one computer is always going to be on and therefore the master, my strategy is that the other computers that are already on the network when I start up will have the TCPSocket initiated by the new device. That will continue to happen when other devices join… the new guy hooks up to all the old ones.

It would seem, then, that I would need a ServerSocket listening, and some other TCPSockets connecting to the existing devices. Here are my questions…

?Síochán!
Gary[/quote]

TCPSockets are not subclassed from Control. So you can create them in a console app. The only items you cannot create are objects subclassed from Control. The first instance of the control must be instantiated on the screen in the IDE first. But sockets are not part of that. So you can instantiate them completely in code.