| Dart Home | PowerTCP Sockets for .NET | Custom Development | Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums |
| Author | Forum: PowerTCP Sockets for .NET (Secure and Standard) Topic: Sending large data |
| yalic From: ertre, KS USA Posts: 1 Member Since: 03/18/05 |
posted March 18, 2005 7:56 AM Hello, I am considering an upgrade from the standard MS Winsock tool which works quite well with .NET to Power TCP tools We have an internal monitoring solution that sends desktop images (converted to base64 strings wrapped in xml tags) from our monitored internet machines to a server. With the MS winsock tool it would read the data and exit the event so at the end of the event one could call another function to process the data recieved. This is a constant connection that is only closed on closure of the application. I'm a bit confused by the behaviour of recieving large data with PowerTCP (tcp and server components). Within the connection event the documentation shows that one should do a Loop as long as the connection is valid. But when recieving the last block of data the server just waits for more data without exiting the event.What's the best practise for the server to acknowledge that it has just recieved the last block of code for that transmission and then go off and process or should I be looking for the delimiter (which is an xml closing tag eg '</img>') every time a block of data is received? Or should I be creating event handlers to the e.TCP object so that I can use EndRecieve or something similar? 2) I saw a solution recently where a new connection was opened and closed for each transmission of data (similar to connecting to a database, pulling data and closing the connection). Is this how sockets should be used? 3) As mentioned above we send the images as Base64 strings...is there a better way to send images through PowerTCP? Many thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted March 18, 2005 9:23 AM 1) This is entirely dependent on your protocol. They are all different. Take a look at every one of the server samples (SMTP, Pop, Web, Echo) to get a feel for the way different protocols work. 2) Again, completely dependent on what you are doing. HTTP 1.0 behaves like you describe, HTTP 1.1 usually keeps the connection open and uses the "Content-Length" header to determine end of data. FTP uses a combination of both. It has a control connection that remains open and data connections that are established for each request for data. 3) If you are writing the protocol yourself, there would be no need to encode anything and add overhead. You can just send the data out as is and reassemble it at the other end. Base64 is used as a way to send binary data to servers that don't understand all binary characters (like an SMTP server) |
| Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|