创建插座一个SQL-CLR触发器或存储过程中 [英] Creating socket inside a SQL-CLR trigger or stored procedure

查看:298
本文介绍了创建插座一个SQL-CLR触发器或存储过程中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL Server 2008中发送消息到插座服务器SQL-CLR触发器。它工作正常,但我需要的TCP客户端保持连接状态,将它与通信的服务器。

I have a SQL-CLR trigger in SQL Server 2008 that sends out message to socket server. It works fine but I need the TCP client to stay connected to the server it communicates with.

为了做到这一点,我必须做出一些线程保持活着。所以,我创建了一个线程增加了消息排队,我看到客户端连接但SQL Server踢出来之前,客户端能够处理排队的消息,并将其发送给TCP服务器。

In order to do this I have to make some thread that stays alive. So I created a thread added the message to queue, I see client connecting but SQL Server kicks out before the client is able to process the queued message and send it to tcp server.

此应用程序的目的是要送什么领域和与之关联的一些价值观是通过XML更新。我希望把他们在获取线程处理队列,并发送到TCP套接字服务器。

The purpose of this application is to send what fields and some values associated to them that were updated via xml. I wanted to put them in queue that gets handled in thread and send to TCP Socket Server.

我所计划的替代现在有CLR触发加消息MSMQ和有其他服务处理这些消息。

What I am planning as alternative now is have CLR Trigger add messages to MSMQ and have another service to process these messages.

有什么好的建议,如何做到这一点?

Any good suggestions how to accomplish this?

推荐答案

CREATE ASSEMBLY消息 授权DBO 从C:\ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \ System.Messaging.dll 的PERMISSION_SET =不安全 GO

CREATE ASSEMBLY Messaging AUTHORIZATION dbo FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll' WITH PERMISSION_SET = UNSAFE GO

这篇关于创建插座一个SQL-CLR触发器或存储过程中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆