.NET remoting rookie. Need HELP! Unhandled Exception

Hi,
I'm just getting into .NET remoting. I've got my rmotable type,, the listener/server and the client. No compile errors, but i get this run error

Unhandled Exception: System.Net.Sockets.SocketException: No connection could be
made because the target machine actively refused it

Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddre
ss socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint
ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortA
ndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWit
hRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage
(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITranspor
tHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMess
age(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at System.Object.Equals(Object obj)
at Client.SampleClient1.Main(String[] args) in C:\Documents and Settings\onib
iyot\My Documents\Visual Studio 2005\Projects\Client1\Client1\SampleClent1.cs:li
ne 30
Press any key to continue . . .

Can anyone help me out? Thanks

[1800 byte] By [nibsi] at [2007-12-22]
# 1

To me it seems that either:

1) a firewall is blocking that port from accepting connections

2) the server has not started the connection service in order to "listen" to that port.

I could be wrong but also believe it could be either reason. I have not doing remoting but the socket exceptions I have had before and found out to be the reason

ahmedilyas at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
How can i check if the firewall is blocking the port if im behind a corporate firewall that's off but using group policy to control the settings?
nibsi at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3

I think it maybe more of the local computer's firewall than the network firewall itself. I'm unsure as this is a bit over my head.

How are you connecting the application? Is it on the same machine? Or different machines but on the same network? Or different machines on different networks?

ahmedilyas at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4
Same machine for now. But would later try 2 different machines on the same network
nibsi at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5

If its on the same machine (connect from same machine to same machine) then it will be a local firewall issue most likely.

So whichever port you are connecting on (example: 1111) add this to your exception list in your local firewall. How? No idea as all firewall software are different to configure but that is pretty much what you need to do.

It would help us also if you had posted some code :-)

ahmedilyas at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6
Thanks ahmedilyas. I tried that b4, its still giving the same problem. ...

I added a port, gave it a name, indicated the port nbr...but still

Hmmm... i really really need this thing to work.

nibsi at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 7

If you can give us some code maybe someone else/me could help.

ahmedilyas at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 8
Finally got a solution. Thanks
nibsi at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 9
Can you tell me what was the solution as i am also trying to get around with the same error..

Im making connection to different host like hotmail and all and im getting this error.. Any pointers?

Thanks in Advance

Harry_ss at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 10

My

case was a very simple one. I didn't have the server app running when i

executed the client.....that was why i was getting that error.

Can

anyone help me out with this I've got a two server remoting app on

the same machine....but i get the error Unhandled exception "Requested

Service not found" Any ideas?

Thanks

sample code from the client
namespace CLIENT
{
public class CLIENT
{
public static void Main(string[] args)
{
TcpClientChannel chan = new TcpClientChannel();
ChannelServices.RegisterChannel(chan);

//create an instance of Scan object
IScanShared ScanObj = (IScanShared)Activator.GetObject(typeof(IScanShared),
"tcp://10.181.54.231:5000/ScanServer");

//create an instance of TestControl object
ITestControlShared TestControlObj = (ITestControlShared)Activator.GetObject(
typeof(ITestControlShared), "tcp://10.181.54.231:3000/TestControlServer");

nibsi at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified