Results 1 to 3 of 3

Thread: [RESOLVED] .Net remoting issue

  1. #1

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Resolved [RESOLVED] .Net remoting issue

    Hey all,

    i have developed a client server remoting application.
    however i have an issue when running the client and the server on the same machine as i receive the following error:
    "Only one usage of each socket address (protocol/network address/port) is normally permitted"

    Is their anyway to get around this.

    Here is the code that i use to create the server:

    and on the client

    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: .Net remoting issue

    Did you forget to post the code?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: .Net remoting issue

    haha... stupid vb code tags didnt work!!!!

    anyway i solved it

    for anyone who has this issue use the TCPServerChannel and TCPClientChannel
    do not use just TCPChannel on both sides.

    CLIENT:
    Code:
    Dim properties As IDictionary = New Hashtable()
    properties.Add("secure", True)
    properties.Add("connectionTimeout", 5000)
    'properties.Add("tokenImpersonationLevel", "Impersonation");
    properties.Add("typeFilterLevel", System.Runtime.Serialization.Formatters.TypeFilterLevel.Full)
    
    _clientChannel = New TcpClientChannel(properties, Nothing)
    
    If ChannelServices.GetChannel(_clientChannel.ChannelName) Is Nothing Then
    * * ChannelServices.RegisterChannel(_clientChannel, True)
    End If
    SERVER:
    Code:
    Dim serverProvider As New BinaryServerFormatterSinkProvider()
    serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
    
    Dim properties As IDictionary = New Hashtable()
    properties.Add("port", 10085)
    properties.Add("secure", True)
    'properties.Add("impersonate", true);
    
    _serverChannel = New TcpServerChannel(properties, serverProvider)
    
    If ChannelServices.GetChannel(_serverChannel.ChannelName) Is Nothing Then
    * * ChannelServices.RegisterChannel(_serverChannel, True)
    End If
    PS i had to comment out impersonate as i have some tasks the run as localsystem using the client and it was causing access issues on the server...
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

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