473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Legacy Client <--> DotNet Listener

I need to keep a few VB6 tcpClients active, but have them talk to a dotNet
tcpServer/tcpListener. The "Server"/Listener is running as a Plugin, and
needs to respond to "outside requests". The dotNet versions of the exe's
that make these requests take MUCH longer to load and start than the VB6
versions, so I'd like to keep the VB6 versions active (at least until the
dotNet versions will load more quickly).

Is there a way for these legacy VB6 programs to communicate with the dotNet
plugin?

TIA,
Geoff
Nov 21 '05 #1
3 1716
Geoff,

There shouldn't be an issue with a VB6 TCPclient sending data to a .NET
TCPListener. Any TCPClient can send data to any TCPlistener (assuming port
settings and protocols have been setup correctly). I use a TCPListener in
one of my VB.NET apps to collect information sent via a socket by a group of
PERL apps.

HTH
Lee

"Geoff" <Ge***@discussi ons.microsoft.c om> wrote in message
news:D1******** *************** ***********@mic rosoft.com...
I need to keep a few VB6 tcpClients active, but have them talk to a dotNet
tcpServer/tcpListener. The "Server"/Listener is running as a Plugin, and
needs to respond to "outside requests". The dotNet versions of the exe's
that make these requests take MUCH longer to load and start than the VB6
versions, so I'd like to keep the VB6 versions active (at least until the
dotNet versions will load more quickly).

Is there a way for these legacy VB6 programs to communicate with the
dotNet
plugin?

TIA,
Geoff

Nov 21 '05 #2
Lee,
Thanks! Good to know it should work. That give sme hope.

But I don't seem to be able to MAKE it work. I'm using "locoalhost " as the
server address, and 9001 as the port address.

Do you know of any websites with sample code for communicating between a
"legacy" app and a dotNet app using this technique?
Geoff

"lgbjr" wrote:
Geoff,

There shouldn't be an issue with a VB6 TCPclient sending data to a .NET
TCPListener. Any TCPClient can send data to any TCPlistener (assuming port
settings and protocols have been setup correctly). I use a TCPListener in
one of my VB.NET apps to collect information sent via a socket by a group of
PERL apps.

HTH
Lee

"Geoff" <Ge***@discussi ons.microsoft.c om> wrote in message
news:D1******** *************** ***********@mic rosoft.com...
I need to keep a few VB6 tcpClients active, but have them talk to a dotNet
tcpServer/tcpListener. The "Server"/Listener is running as a Plugin, and
needs to respond to "outside requests". The dotNet versions of the exe's
that make these requests take MUCH longer to load and start than the VB6
versions, so I'd like to keep the VB6 versions active (at least until the
dotNet versions will load more quickly).

Is there a way for these legacy VB6 programs to communicate with the
dotNet
plugin?

TIA,
Geoff


Nov 21 '05 #3
Geoff,

This is a sample of the code I use for the .NET listener

Private Sub MIBS_DoListen()
' Buffer for reading data
Dim bytes(8192) As [Byte]
Dim data As [String] = Nothing
Try
' Listen for new connections.
MIBSlistener = New TcpListener(Sys tem.Net.IPAddre ss.Any,
MIBS_IPORT_NUM)
MIBSlistener.St art()
Do
If MIBSexethread.I sAlive = False Then
MIBSlistener.St op()
End If
' Create a new user connection using TcpClient
Dim client As TcpClient = MIBSlistener.Ac ceptTcpClient()
Dim stream As NetworkStream = client.GetStrea m()
Dim i As Int32
' Loop to receive all the data sent by the client.
i = stream.Read(byt es, 0, bytes.Length)
While (i <> 0)
' Translate data bytes to a ASCII string.
data = System.Text.Enc oding.ASCII.Get String(bytes, 0, i)
Console.WriteLi ne([String].Format("Receiv ed: {0}",
data))
' Process the data sent by the client.
MIBS_endok = 2
Update_MIBS_Sta tus(data)
i = stream.Read(byt es, 0, bytes.Length)
End While
Loop Until False
Catch
End Try
Update_MIBS_Sta tus("DROPPED")
End Sub

I set the port number (MIBS_IPORT_NUM ) at runtime based on a search of
available ports, then pass the port number as a command line argument to the
external PERL app to use as the Client Port Number. This way I never have
port conflicts and I don't need to worry about hard coding a port number
that a certain user may have blocked in a firewall.

For the client, I don't have VB6 code (LOL, actually, I don't have .NET code
either, at least not handy!), but, as long as the port number is the same
(while using System.Net.IPAd dress.Any), the listener will receive whatever
any app dumps onto the port.

While debugging, I write all of the received data to the console as well as
to wherever I want it to go (sometimes it doesn't go where I want it to
go!). So having the console output at least lets me know it was received.
the Update_MIBS_Sta tus function is just a bunch of RegEx expressions that
determine where the data received will be displayed on the form.

I know, somewhere, I have a .NET TCPListener / TCPClient app. If I can find
it, I'll post it for you.

HTH
Lee

"Geoff" <Ge***@discussi ons.microsoft.c om> wrote in message
news:26******** *************** ***********@mic rosoft.com...
Lee,
Thanks! Good to know it should work. That give sme hope.

But I don't seem to be able to MAKE it work. I'm using "locoalhost " as the
server address, and 9001 as the port address.

Do you know of any websites with sample code for communicating between a
"legacy" app and a dotNet app using this technique?
Geoff

"lgbjr" wrote:
Geoff,

There shouldn't be an issue with a VB6 TCPclient sending data to a .NET
TCPListener. Any TCPClient can send data to any TCPlistener (assuming
port
settings and protocols have been setup correctly). I use a TCPListener in
one of my VB.NET apps to collect information sent via a socket by a group
of
PERL apps.

HTH
Lee

"Geoff" <Ge***@discussi ons.microsoft.c om> wrote in message
news:D1******** *************** ***********@mic rosoft.com...
>I need to keep a few VB6 tcpClients active, but have them talk to a
>dotNet
> tcpServer/tcpListener. The "Server"/Listener is running as a Plugin,
> and
> needs to respond to "outside requests". The dotNet versions of the
> exe's
> that make these requests take MUCH longer to load and start than the
> VB6
> versions, so I'd like to keep the VB6 versions active (at least until
> the
> dotNet versions will load more quickly).
>
> Is there a way for these legacy VB6 programs to communicate with the
> dotNet
> plugin?
>
> TIA,
> Geoff


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
47049
by: NotNeo | last post by:
I am getting a strange symptom: tnsping and sqlplus work fine on my LINUX server (neo) so the listener and DB are OK. However, from my remote XP Client (tank) I get TNS-12560. I can ping the neo from tanks and tank from neo so it isn't a network problem. The trace file shows that in can't start the transport layer due to an error 530: Tns error struct: nr err code: 0 ns main err code: 12560 TNS-12560: TNS:protocol adapter error
13
2957
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded. I believe a dotNet solution is better, but I'm trying to be as convincing as possible -- and maybe I'm wrong! I would appreciate any input or references which could help me.
0
1079
by: Tim Zych | last post by:
I have an asp.net web application that I use with an Access data backend. I want to add a mini-client "offline" DotNet Windows App component in the event that I don't have an internet connection or maybe for some other reason. I envision downloading the data from the online version as needed (say using a web service) and loading that into the client version. How should I go about this? Should I store the data as XML and use that as a...
2
6880
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless there is a problem with the connection. I need to know which client has sent the incoming data as each client has its own buffer on my "server" app. I am using the standard asynch socket code from MSDN to listen for connections and they...
13
2168
by: John Kotuby | last post by:
I am expecting the answer to be, "of course not" or " are you kidding?", but maybe (hopefully) I am wrong and somebody can point me to an ingenious example of how the impossible just takes a little more work. TIA
1
1165
by: pam | last post by:
I have created a connection on client and server. Dim Client As TcpClient = Listener.AcceptTcpClient but there is no property to get the client's ip? how could I do it?
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10346
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6863
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.