Click here to Skip to main content
13,190,405 members (48,865 online)
Rate this:
Please Sign up or sign in to vote.
I am pretty new to this Networking stuff in .net.

I need to establish a TCP channel between 2 machines and their ports.
Machine A is vncclient, Machine B acts as Routing Server, Machine C is vncserver.

1.Machine A Sends the requests to MachineB 5900 port
2.Need to establish a channel which gets the data from MachineB 5900 and fwd the data to Machine C 5900 and viceversa.
3.This program needs to be run on Machine C Server.

private void Connectandtransfer(IPAddress1, port1,IpAddress2, port2)
//need to extablish a bidirectional channel. 

In this case how can i avoid the self looping of data?

I am confused on how to achieve this as Sockets,TCpChannel, Remoting, TCP Hole punching, Port forwarding look much similar.. But none of them satisfied my requirement.

Please guide me on how to achieve this.
Posted 4-Oct-12 15:56pm
Updated 8-Jul-16 23:49pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Using VB6 or C# Language, I think you should try to Execute netsh Command Using
Shell( ) to port forward, see the commands below:
' --------------------------------------------------
' To Port Forwar Use:

netsh interface portproxy add v4tov4 listenport=3000
listenaddress=l.l.l.l connectport=4000 connectaddress=

' To Remove Port Use:

netsh interface portproxy delete v4tov4 listenport=3000

Hope you Can Do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171016.2 | Last Updated 9 Jul 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100