开发者

Share data between C# server process and website

开发者 https://www.devze.com 2023-04-12 17:33 出处:网络
I have written a C# server which listens for Tcp connections. A client can connect to the s开发者_StackOverflow社区erver and send data, mostly filenames. The data that the server receives needs to be

I have written a C# server which listens for Tcp connections. A client can connect to the s开发者_StackOverflow社区erver and send data, mostly filenames. The data that the server receives needs to be shown on a website written in ASP.NET.

I was thinking of using pipes to send the data from the server process to the website. Is this the right way to do it or are there other (smarter) ways of doing this?


I don't think pipe are an option since the process hosting the website ( the worker process ) can be recycled at any moment and you dont have control on this. Is better to have a plain old database to share information between your service and the asp.net app. If you think the db is too much, you can use a plain file ( or an xml does not matter ) but in this case you have to keep an eye to the concurrency since both process can concurrently try to open the file.


You can write a WCF service which can talk to client/server and website on different protocols.....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号