CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Remoting Error

  1. #1
    Join Date
    Apr 2008
    Posts
    38

    Remoting Error

    hi i had created a window service. which fetches value from database and send it to destination machine using socket programming. its works fine before. but suddenly i am getting the following error.please provide me any solution.

    Remoting configuration failed with the exception 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
    at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Bind(EndPoint localEP)
    at System.Net.Sockets.TcpListener.Start(Int32 backlog)
    at System.Net.Sockets.TcpListener.Start()
    at System.Runtime.Remoting.Channels.ExclusiveTcpListener.Start(Boolean exclusiveAddressUse)
    at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object data)
    at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()
    at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
    at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
    at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Runtime.Remoting.RemotingConfigHandler.CreateChannelFromConfigEntry(ChannelEntry entry)
    at System.Runtime.Remoting.RemotingConfigHandler.ConfigureChannels(RemotingXmlConfigFileData configData, Boolean ensureSecurity)
    at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData, Boolean ensureSecurity)

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Remoting Error

    Can you post your code here ?
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: Remoting Error

    Only one usage of each socket address (protocol/network address/port) is normally permitted
    Looks like you are trying to use a port that is already in use

  4. #4
    Join Date
    Apr 2008
    Posts
    38

    Re: Remoting Error

    String szIPSelected = EndPointIPA;
    int szPort = EndPointPort;

    int RecTimeout = TimeOut;

    remoteIPAddress = System.Net.IPAddress.Parse(szIPSelected);
    remoteEndPoint = new System.Net.IPEndPoint(remoteIPAddress, szPort);

    try
    {

    socClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    socClient.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, RecTimeout);
    Isconnected = SocketConnection.socClient.Connected;
    if (!Isconnected)
    {
    socClient.Connect(remoteEndPoint);


    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured