WCF / Single instance / multple concurrency question
-
Hi, I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF. I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image. I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency. Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary? Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work? Thank you! NOTE: using framework 3.5
-
Hi, I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF. I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image. I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency. Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary? Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work? Thank you! NOTE: using framework 3.5
It is a little unclear as to what the setup is. Are there 9 servers and 9 clients (each running their own instance of WCF)? Or is there only 1 WCF service and 9 different clients accessing that same instance of the WCF service? If you are just having the WCF service build an image and do no server side logic, I would remove the WCF service all together. If there is server side logic, then 1 instance of the WCF service is usually ideal since you only need to update the application in 1 place and the clients all get the functionality (unless the clients require an update as well).
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
-
It is a little unclear as to what the setup is. Are there 9 servers and 9 clients (each running their own instance of WCF)? Or is there only 1 WCF service and 9 different clients accessing that same instance of the WCF service? If you are just having the WCF service build an image and do no server side logic, I would remove the WCF service all together. If there is server side logic, then 1 instance of the WCF service is usually ideal since you only need to update the application in 1 place and the clients all get the functionality (unless the clients require an update as well).
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
Thank you for your reply. My configuration is your second one: 1 WCF service for 9 Clients. There is not much server logic in the WCF, but since is a generic Barcode generator placed in a context where a lot of applications could use it, I think that is a good choice to have it in WCF instead of inside the main project. I will do some benchmatks to understand better if it is an issue or not. However, my question regards how to use (and consume) wcf: I have to declare simply:
public static BarcodeServiceClient BarcodeServiceClient
{
get
{
if (_barcodeServiceClient == null)
{
_barcodeServiceClient = new BarcodeServiceClient();
}
return _barcodeServiceClient;
}
}OR I have to manage channels?
-
Thank you for your reply. My configuration is your second one: 1 WCF service for 9 Clients. There is not much server logic in the WCF, but since is a generic Barcode generator placed in a context where a lot of applications could use it, I think that is a good choice to have it in WCF instead of inside the main project. I will do some benchmatks to understand better if it is an issue or not. However, my question regards how to use (and consume) wcf: I have to declare simply:
public static BarcodeServiceClient BarcodeServiceClient
{
get
{
if (_barcodeServiceClient == null)
{
_barcodeServiceClient = new BarcodeServiceClient();
}
return _barcodeServiceClient;
}
}OR I have to manage channels?
You shouldn't have to manage channels. You only need to if you are trying to use features of channels. Look up some basic WCF articles here on CodeProject. You are basically just trying to execute a remote method. That is very straight forward with WCF.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
-
You shouldn't have to manage channels. You only need to if you are trying to use features of channels. Look up some basic WCF articles here on CodeProject. You are basically just trying to execute a remote method. That is very straight forward with WCF.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
Thank you!