Is there a example to receive Strings as a client with TCP?
Have you looked in the Example Projects folder with your Xojo installation?
Example Projects/Communication/Internet has a whole bunch that demonstrate all kinds of things you can do with all the sockets (TCP included).
Oh, I see, thank you.
But I don’t understand.
The client has 21 TCP Sockets and the server only one.
Can anyone explain these examples?
Why don’t you tell us what you want to do?
To understand the example you play around with it, then you hammer your head a couple of times to the keyboard until the wisdom flows. I’d guess that the 21 TCP socket simulate 21 clients.
I want to create a tcp client. But I don’t understand why there are 21 TCP sockets.
Delete twenty of them and see what happens with just the one left…
Hi Stefan - I’ll try to be as gentle as possible, as you seem to be relatively new to Xojo and perhaps programming in general:
@Beatrix Willius hinted at it already: There are 21 sockets in your example to simulate 21 clients connecting to the server.
At least, that’s what I (and anyone else reading) is assuming, since you have not really given us much information at all - such as which example you are looking at, or more precisely what you want to do. “I want to create a tcp client” is about as useful to us as if you were to approach a mechanic and say “I want to fix my car”. What’s wrong with it?
In short: your request is meaningless without specifics.
You’ll get TONS of help here if you give more detail. Vague, obtuse 1 sentence answers won’t get much in the way of a response.
Ok, so what I have to ask in this forum to get help?
I don’t know which questions you want answer?
“Can anyone explain these examples?” What is wrong at this question?
“Can anyone explain these examples?” - there are more than 20 example projects included with Xojo that are just about networking with sockets. Your questions makes me think you want me to take the time to explain all of them.
Sorry, nobody here has that kind of time.
If you care to pick out a specific example that you don’t understand, I’m sure that someone would be happy to explain at least an overview of what the example is and how it works.
Specificity - that’s the key. You can’t go to the mechanic and say “my car is broken - fix it”, you need to say something like: “my car is acting up in the following manner: when I turn left, there is a squeaky noise coming from the rear part of the car, but only when I do it at speeds lower than 15 miles an hour.”
Sounds like you’re looking at Examples>Communication>Internet>ServerSocketClientTest.
It took me a while to grasp the concepts of that example as well but now I use TCP communication a lot. In the example the client has 21 sockets and every time the connect button is pressed an new socket/connection is made to the server. It sounds like for your purpose you need a single socket the send multiple messages on.