Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: How to Close the Connections of a TCPServer ...
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 22, 2004 8:38 AM

In your CharGenServer the Connections runs ahead when i called Server1.Close(), the Documentations says, that the Server is closed but the Open Connections are Running. How can i close this running Connections one by one?

Christian
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 22, 2004 8:46 AM

Use Server1.Abort to cause all the connections to close and stop listening at the same time.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 22, 2004 10:04 AM

Thank you
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 22, 2004 10:29 AM

Tony, what do you mean, how can i generate a RoundTrip anto all Tcp-Connections an a Server.

Server1.Connections... and than

Something with foreach()

Christian
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 22, 2004 10:38 AM

I am sorry but I don't understand what you are asking. Perhaps you can state it a different way?
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 22, 2004 1:44 PM

Okay, i´ve one TcpServer with may be 10 Clients in Threads. Now i want to tell any information onto all these Clients connected to the Server.

I think there are two ways, to use a flag (set by my form) which i check in the Server1_connection Event and then send the special information from there or i need all IP-Addresses of the connected Clients and send it via another port out of the form.

What can i get through Server1.Conection (on Tcp-Socket-Level)? Anything about the Socket?

By the way another question: Does e.Tcp.Receive(puffer) wait until a byte dropped in or does it run all times through the while-loop, is the could under it walked through if there is no byte recived. If not, the flag is only asked for, when the client communicates. Thats not good.

Hm, i hope you can understand me ...

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 22, 2004 2:13 PM

Have you looked at the Server.Connections property? This contains an arraylist of Tcp objects. You could use the Tag property of the Tcp object to store a class that contains extra information.

If I understand your second question correctly I think the answer is if you call Receive and there is no data to receive within the timeout period, you will get an error. If you want to wait for data that will come at an undetermined time, use BeginReceive and EndReceive.

If that does not answer your question, please repost in a different thread. Please try to rephrase because the statement "is the could under it walked through if there is no byte recived. If not, the flag is only asked for, when the client communicates" makes no sense to me.
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX