开发者

How to release the ports' occupation in the Server side in NET remoting?

In my application, client can request service from server side while server can send events to client side.

In .NET remoting the event mechanism is implemented by bi-directional channels, while in this case the actual client plays another role of "server" for events. Normally the client will open a free port for this kind of communication.

When I run the netstat CMD in server side, I ca开发者_如何学Cn see this server established many connection to others clients via different ports.

My problem is when some clients are closed out, the connection to the above ports of those clients shall not be visible again. But actually not...

Anybody know how to release the connection from server to clients?


You have to dispose your connection objects. Did you do it ?

[EDIT] My guess is that such objects do have underlying connections open. Those objects shall implement the IDisposable interface and .Dispose() must called and release the resources (connections/ports in your case) hold by your objects. Hope that helps :-/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜