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 update FormControls in Connection.Execeute
cuhlig
info.mail@uhligweb.de

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

I want to Update some Form Controls like Listviews and save this information into a sql database.

The ListviewUpdate is done in the samples in the server1_connection method.

It´s just a beginner-question
Tony Priest



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

The samples all show how to update information in the connection event. They don't do anything with SQL, but hopefully they will get you started.

cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 2:09 PM

Hm, all the samples (so far i found) use the BeginInvoke the server1_Connection.

Okay, i see alle the incomming bytes in the connection.execute. But what, when i want to do something on the Form (ListView, DataSet) depending on the Data. All samples send the information only back or write it into the files on harddisk (inside the connection.execute) or i found it not ...

It would help me to find arguments here in my company to buy your product.

Thanks for yout help

Christian
Tony Priest



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

We update the textbox to show that a connection was established. BeginInvoke is used because any changes made on the main thread (where the form is) have to be marshalled, due to the fact that each connection is operating in it's own thread.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 2:18 PM

And how?

At the Moment i think about a Returncode in the conn.execute() inside the server1_Connection. So i can use the BeginInvoke, what do you mean?

I can do all calculations in the conn.execute include a send() to via a new TcpClient on to an other (not the connected in this Thread) TcpServer.

BTW: It is good to get help so quick.
Tony Priest



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

I'm sorry, but I don't understand what you are asking. I pointed you to the samples because it's the only working demonstration of the product that we have.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 2:32 PM

Okay, sorry, i´m just a beginner. I can show some Informations about the Connection in the Server-Samples, all are generated in the server1_Connection() of the Forms-Server.

When Data come in (in this case binary) i want to calculate some values (i can do inside the conn.execute() ) and bring this information on the form, i think the best way is to return some strings when conn.execute() ends into the server1_connection() and BeginInvoke them (Uff...).

But also i want, depending on the incomming data, send some other information to TcpServer arround which i know through the incomming data, may be this or that other TcpServer. So i want to create a TcpClient on the fly inside the conn.Execute() to get all fast.

Hm...
Tony Priest



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

I'm sorry, but I still don't understand. It doesn't look like I am going to be able to help you here on the forum. Try contacting us directly at support@dart.com to discuss other support options.

cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 2:37 PM

Okay, how long are you reachable today (here it is 20:30 pm)
Tony Priest



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

We're here another 3 hrs or so.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 4:03 PM

Thi sis near them what i want, but i get an *.licx error when try to run...

private void server1_Connection(object sender, ConnectionEventArgs e)
{
string id = e.Tcp.RemoteEndPoint.ToString();
try
{
//Add to Status Box
BeginInvoke(new UiDelegate(ShowStatus), BuildObjectArray("[" + id + "] Connection established"));

//Add to Connections List
BeginInvoke(new UiDelegate(AddConnection), BuildObjectArray(id));
try
{
// Keep receiving data until connection is closed
while(e.Tcp.Connected)
{
byte[] puffer = new byte[32];
//While connected, send charString
string s = e.Tcp.Receive(puffer).ToString();
string dummy = puffer[4].ToString();
BeginInvoke(new UiDelegate(AddConnection), BuildObjectArray(dummy));

// Connect to an Echo server (typically port 7)
tcp1.Connect("192.168.188.241", 49154);

// Send some data
tcp1.Send(puffer);

// In the Echo protocol, the server waits until the client closes the connection.
tcp1.Close();
}
}
catch(Exception ex)
{
// eat any exceptions
}
}
catch (Exception ex)
{
BeginInvoke(new UiDelegate(ShowStatus), BuildObjectArray("[" + id + "] " + ex.Message.ToString()));
}
finally
{
//Append to Status Box
BeginInvoke(new UiDelegate(AppendStatus), BuildObjectArray("[" + id + "] Connection closed"));

//Remove from Connections List
BeginInvoke(new UiDelegate(RemoveConnection), BuildObjectArray(id));
}
}
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 8, 2004 4:18 PM

Did you follow the directions in the message? It sounds like you need to add a licx to the project.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 4:28 PM

Yes, but i think i do it wrong. If i generate an empty file nothing happend, if i write any text into it it cant converted into binary (or so) an it is not show in the project any way?
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 8, 2004 4:29 PM

Can it be because i use 2 Elements the Server and Client in one project?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 8, 2004 4:34 PM

Just add the same licx from the sample to your project (not the solution) The licx should contain a list of the controls that you create in your app. The one from the sample looks like this:

Dart.PowerTCP.Sockets.Server, Dart.PowerTCP.Sockets

If you are creating a new connection it would be like this:

Dart.PowerTCP.Sockets.Server, Dart.PowerTCP.Sockets
Dart.PowerTCP.Sockets.Tcp, Dart.PowerTCP.Sockets



Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 8, 2004 4:36 PM

Also, a licx will not show in the project unless you select "Show All Files" in the Project Explorer.
cuhlig
info.mail@uhligweb.de

From: Suedbrookmerland, Germany
Posts: 25
Member Since: 04/08/04
posted April 12, 2004 12:35 PM

Thank you, now i tested all around. Lets cloas this Topic, i´ll open 2 new.
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX