473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 1692
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***@discussions.microsoft.com> wrote in message
news:D1**********************************@microsof t.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***@discussions.microsoft.com> wrote in message
news:D1**********************************@microsof t.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(System.Net.IPAddress.Any,
MIBS_IPORT_NUM)
MIBSlistener.Start()
Do
If MIBSexethread.IsAlive = False Then
MIBSlistener.Stop()
End If
' Create a new user connection using TcpClient
Dim client As TcpClient = MIBSlistener.AcceptTcpClient()
Dim stream As NetworkStream = client.GetStream()
Dim i As Int32
' Loop to receive all the data sent by the client.
i = stream.Read(bytes, 0, bytes.Length)
While (i <> 0)
' Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i)
Console.WriteLine([String].Format("Received: {0}",
data))
' Process the data sent by the client.
MIBS_endok = 2
Update_MIBS_Status(data)
i = stream.Read(bytes, 0, bytes.Length)
End While
Loop Until False
Catch
End Try
Update_MIBS_Status("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.IPAddress.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_Status 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***@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.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***@discussions.microsoft.com> wrote in message
news:D1**********************************@microsof t.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
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...
13
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....
0
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...
2
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...
13
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...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.