As usual the need arises for a better and securer way to transfer the files across a net. In the case I'm dealing with it's a server sending file to the clients, with the extra requirement of being able to "put the files for the client".
Meaning:
1. The client connects to the server and requests which updates should it do.
2. The client downloads the updates.
3. The client notifies the server that everything is OK.
Pretty simple when put this way, getting it from the customer is like taking a pin out of the ass using boxing-gloves.
In order to support more than a few clients, actually I need to support a few hundreds of them, I decided to use a DB. Since I don't want the server to be crippled, but I want the DB to be a fileDB, I went for the FireBird a good fileDB. For those who think about mdb, I'll remind you I want the server to run without human-maintenance every other day.
In general there's a table for the stations, the files and a connection table.
Next build the WebService:
There are basically 3 methods for the service:
1. GetUpdatesList(string Station)
2. GetFile(string fileID)
3. CompareFileHashes(string fileID, string Hash)
In order to add security the GetFile implements encryption (and the client implements the decryption.)
The CompareFileHashes is also an indication that a transfer was completed, and knowing the quality of the lines I'll use it's an important check.
Of course once you get to the actual writing the 3 methods get a dozen support methods which are hidden, the client application has to implement some safeguarding, and the whole system has to implement a logging mechanism in order for the future debugging / trouble locating. As I've already stated the hardware I'll have to put it on is shaky at best.
P.S. There's no code in this post, I didn't find a reason to put the code behind the methods or the creation of the tables. It seems almost obvious, but if I'll find something interesting while debugging this, I'll put it in a new post with the methods code (well, the closest I'm allowed anyway...)
Sunday, January 20, 2008
Wednesday, January 9, 2008
Debugging a playlist
I'm back:) And married.
My current project involves the famous "Windows Media Services" (WMS). Mainly what I had to do is devise a way to play a continuos list while the list is being updated.
That thing can be easily achieved using the httpd directive and refering it to an ASP/ASP .NET generated SMIL.
The problems begin when you want to debug this process... There's no way to get the actual SMIL from the publishing point, at least not by any means which we considered harmless.
There's a way to bypass it by attaching a small monitor utility to the publishing point. It's potential for strange effects has been considered too great.
The second method, the method I already implemented for debugging purposes, is save the SMIL from within the ASP.
The last option, which is the best if you can afford it, is build your own plug-in. In this case you'll need the enterprise edition (otherwise it might not function on the next version).
Once you got past the first obstacle, comes the bigger one. How do we test it? In our case it was easy. Once I made a player-wrapper for a different check, adding the "write what you played" function to it was easy. Just to be sure we're on the right truck, I added a <clientData Title="filename">. This way I got the comparison between the "Original" and the "Actual"
As a by product (mainly for later debugging usage) I made a small routine that runs over the events the server's recorded and returns them:
WMSServerLib.WMSServer Server;
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server");
Server = (WMSServerLib.WMSServer)Activator.CreateInstance(tServerType);
string res = "";
WMSServerLib.IWMSDiagnosticEvents Events;
Events = Server.DiagnosticEvents;
foreach (WMSServerLib.IWMSDiagnosticEvent evnt in Events)
{
res += "Event: " + evnt.PublishingPointName + "\r\n";
res += "Time: " + evnt.Time.ToString() + "\r\n";
res += evnt.Name + " - " + evnt.ErrorCode.ToString() + "\r\n";
res += evnt.AdditionalInfo + "\r\n";
}
return res;
This code was copied from M$, and editted a bit to fit my needs at the time.
My current project involves the famous "Windows Media Services" (WMS). Mainly what I had to do is devise a way to play a continuos list while the list is being updated.
That thing can be easily achieved using the httpd directive and refering it to an ASP/ASP .NET generated SMIL.
The problems begin when you want to debug this process... There's no way to get the actual SMIL from the publishing point, at least not by any means which we considered harmless.
There's a way to bypass it by attaching a small monitor utility to the publishing point. It's potential for strange effects has been considered too great.
The second method, the method I already implemented for debugging purposes, is save the SMIL from within the ASP.
The last option, which is the best if you can afford it, is build your own plug-in. In this case you'll need the enterprise edition (otherwise it might not function on the next version).
Once you got past the first obstacle, comes the bigger one. How do we test it? In our case it was easy. Once I made a player-wrapper for a different check, adding the "write what you played" function to it was easy. Just to be sure we're on the right truck, I added a <clientData Title="filename">. This way I got the comparison between the "Original" and the "Actual"
As a by product (mainly for later debugging usage) I made a small routine that runs over the events the server's recorded and returns them:
WMSServerLib.WMSServer Server;
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server");
Server = (WMSServerLib.WMSServer)Activator.CreateInstance(tServerType);
string res = "";
WMSServerLib.IWMSDiagnosticEvents Events;
Events = Server.DiagnosticEvents;
foreach (WMSServerLib.IWMSDiagnosticEvent evnt in Events)
{
res += "Event: " + evnt.PublishingPointName + "\r\n";
res += "Time: " + evnt.Time.ToString() + "\r\n";
res += evnt.Name + " - " + evnt.ErrorCode.ToString() + "\r\n";
res += evnt.AdditionalInfo + "\r\n";
}
return res;
This code was copied from M$, and editted a bit to fit my needs at the time.
Subscribe to:
Posts (Atom)