Socket and DLL, Tough One

CCJJ

New member
Joined
Jan 12, 2007
Messages
1
Programming Experience
3-5
Hello All,
I have an off the shelf Windows app that is capable of calling a dll. Actually it calls a C++ wrapper which calls my VB.NET dll ( a VB.NET function ) and all is working fine. The VB.NET dll is designed to open a socket to a server and send messages using System.Net.Sockets. The VB.NET dll also starts a timer to send regular messages to the server in order to keep the socket open and displays a simple UI to handle additional messages that the user might want to send. All this is working fine...but here comes the problem.

When the Windows app wants to send more messages it calls the dll that has previously created the UI and opened the socket that is now sending regular messages. That is to say the socket is already open and being used but I want my Windows app to be able to send additional messages. Long story short, every time the dll is called it wants to start another UI and socket.

I'm stuck with the Windows app and the fact that I have to send messages out through the dll. I also need to keep the socket alive once I open it up by sending regular messages to the server.

What I am wondering is...can I solve this with the current configuration in some way (preferable). Or can I create a separate VB.NET windows application that connects to the server and sends regular messages. Then I would have the messages coming from my off the shelf Windows app call a simplified VB.NET dll that grabs the socket that by VB.NET windows application is using ( if this is possible ) and sends out it's message.

Any help would be greatly appreciated.
 
Back
Top