[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

firewall problems....I think?

Adam Snider

7/19/2004 6:40:00 AM

Okay, I'm trying to get a simple remoting example application working. I
have two computers hooked up to a router/firewall and I'm testing out
remoting between the two. The server code looks like the following:

Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.tcp
Imports ExchangeObjects
Module Module1
Sub main()
Console.WriteLine("exhange host started")

Dim props As IDictionary = New Hashtable(3)
props("name") = "RouterName"
props("port") = 10000
props("machinename") = "192.168.1.103"

Dim channel As New TcpChannel(props, Nothing, Nothing)
ChannelServices.RegisterChannel(channel)

Dim exchange As New Exchange
RemotingServices.Marshal(exchange, "Exchange")

Console.ReadLine()

End Sub
End Module



The client code looks like the following:

Imports System.Runtime.Remoting
Imports ExchangeObjects
Module Module1
Sub main()
Dim url As String = "tcp://192.168.1.1:10000/Exchange"
Dim exchange As Exchange =
CType(RemotingServices.Connect(GetType(Exchange), url), Exchange)
Dim index As Integer = exchange.NextOrder
Console.WriteLine("client: nextorder returned: " & index)
End Sub
End Module

Now, I've enabled forwarding on my router to the ip address of the server
side code using port 10000. Any ideas as to what I'm doing wrong???? I
don't have a static IP address from my cable modem company, does that
matter??? Any help would be greatly appreciated!!!!

Thanks,
Adam Snider


4 Answers

Sunny

7/19/2004 3:02:00 PM

0

Hi,
your machineName shoud be your external IP address, not the internal
one.

Also, the channel properties are case sensitive, so the right one is
"machineName".

Sunny

In article <uUTYCnUbEHA.3016@tk2msftngp13.phx.gbl>,
adam.snider@comcast.net says...
> Okay, I'm trying to get a simple remoting example application working. I
> have two computers hooked up to a router/firewall and I'm testing out
> remoting between the two. The server code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports System.Runtime.Remoting.Channels
> Imports System.Runtime.Remoting.Channels.tcp
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Console.WriteLine("exhange host started")
>
> Dim props As IDictionary = New Hashtable(3)
> props("name") = "RouterName"
> props("port") = 10000
> props("machinename") = "192.168.1.103"
>
> Dim channel As New TcpChannel(props, Nothing, Nothing)
> ChannelServices.RegisterChannel(channel)
>
> Dim exchange As New Exchange
> RemotingServices.Marshal(exchange, "Exchange")
>
> Console.ReadLine()
>
> End Sub
> End Module
>
>
>
> The client code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Dim url As String = "tcp://192.168.1.1:10000/Exchange"
> Dim exchange As Exchange =
> CType(RemotingServices.Connect(GetType(Exchange), url), Exchange)
> Dim index As Integer = exchange.NextOrder
> Console.WriteLine("client: nextorder returned: " & index)
> End Sub
> End Module
>
> Now, I've enabled forwarding on my router to the ip address of the server
> side code using port 10000. Any ideas as to what I'm doing wrong???? I
> don't have a static IP address from my cable modem company, does that
> matter??? Any help would be greatly appreciated!!!!
>
> Thanks,
> Adam Snider
>
>
>

Sunny

7/19/2004 3:08:00 PM

0

Hey, wait :)

I haven't seen your client code before I posted the prev message.

Why are you speaking about router forwarding? Is there a router between
your client and server? Are they on different networks?

If they are, than my prev. post is OK. But if both the server and the
client are on the same network, than you do not need machineName and
setting up the router.

Sunny


In article <uUTYCnUbEHA.3016@tk2msftngp13.phx.gbl>,
adam.snider@comcast.net says...
> Okay, I'm trying to get a simple remoting example application working. I
> have two computers hooked up to a router/firewall and I'm testing out
> remoting between the two. The server code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports System.Runtime.Remoting.Channels
> Imports System.Runtime.Remoting.Channels.tcp
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Console.WriteLine("exhange host started")
>
> Dim props As IDictionary = New Hashtable(3)
> props("name") = "RouterName"
> props("port") = 10000
> props("machinename") = "192.168.1.103"
>
> Dim channel As New TcpChannel(props, Nothing, Nothing)
> ChannelServices.RegisterChannel(channel)
>
> Dim exchange As New Exchange
> RemotingServices.Marshal(exchange, "Exchange")
>
> Console.ReadLine()
>
> End Sub
> End Module
>
>
>
> The client code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Dim url As String = "tcp://192.168.1.1:10000/Exchange"
> Dim exchange As Exchange =
> CType(RemotingServices.Connect(GetType(Exchange), url), Exchange)
> Dim index As Integer = exchange.NextOrder
> Console.WriteLine("client: nextorder returned: " & index)
> End Sub
> End Module
>
> Now, I've enabled forwarding on my router to the ip address of the server
> side code using port 10000. Any ideas as to what I'm doing wrong???? I
> don't have a static IP address from my cable modem company, does that
> matter??? Any help would be greatly appreciated!!!!
>
> Thanks,
> Adam Snider
>
>
>

Adam Snider

7/19/2004 6:32:00 PM

0

Thanks for the reply.....I actually finally got the simple example working
once I realized that internal ip address of the router and the external ip
address of the router were different!!! I'm new at this:)

I do have another question though. Suppose I have a class from a class
library that opens a database connection. I reference this class in both my
server code and my client code although it is only called within the server
code. For some reason, my client seems to want to open the database
connection itself, for instance, it returns an error saying the path to the
database could not be found. Why would it be giving me that error if the
server code is the one that is opening the connection? Any ideas?

Thanks,
Adam


"Adam Snider" <adam.snider@comcast.net> wrote in message
news:uUTYCnUbEHA.3016@tk2msftngp13.phx.gbl...
> Okay, I'm trying to get a simple remoting example application working. I
> have two computers hooked up to a router/firewall and I'm testing out
> remoting between the two. The server code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports System.Runtime.Remoting.Channels
> Imports System.Runtime.Remoting.Channels.tcp
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Console.WriteLine("exhange host started")
>
> Dim props As IDictionary = New Hashtable(3)
> props("name") = "RouterName"
> props("port") = 10000
> props("machinename") = "192.168.1.103"
>
> Dim channel As New TcpChannel(props, Nothing, Nothing)
> ChannelServices.RegisterChannel(channel)
>
> Dim exchange As New Exchange
> RemotingServices.Marshal(exchange, "Exchange")
>
> Console.ReadLine()
>
> End Sub
> End Module
>
>
>
> The client code looks like the following:
>
> Imports System.Runtime.Remoting
> Imports ExchangeObjects
> Module Module1
> Sub main()
> Dim url As String = "tcp://192.168.1.1:10000/Exchange"
> Dim exchange As Exchange =
> CType(RemotingServices.Connect(GetType(Exchange), url), Exchange)
> Dim index As Integer = exchange.NextOrder
> Console.WriteLine("client: nextorder returned: " & index)
> End Sub
> End Module
>
> Now, I've enabled forwarding on my router to the ip address of the server
> side code using port 10000. Any ideas as to what I'm doing wrong???? I
> don't have a static IP address from my cable modem company, does that
> matter??? Any help would be greatly appreciated!!!!
>
> Thanks,
> Adam Snider
>
>


Adam Snider

7/19/2004 6:33:00 PM

0

Thanks for the reply.....I actually finally got the simple example working
once I realized that internal ip address of the router and the external ip
address of the router were different!!! I'm new at this:)

I do have another question though. Suppose I have a class from a class
library that opens a database connection. I reference this class in both my
server code and my client code although it is only called within the server
code. For some reason, my client seems to want to open the database
connection itself, for instance, it returns an error saying the path to the
database could not be found. Why would it be giving me that error if the
server code is the one that is opening the connection? Any ideas?

Thanks,
Adam