.net remoting and tcp listener socket

Discussion in 'ASP .Net' started by Danish Ahmed, Apr 20, 2005.

  1. Danish Ahmed

    Danish Ahmed Guest

    Hi,

    I am using .net remoting with tcp channel and a tcp socket for accepting
    connections in a console application. When I run the application first time
    everything works fine but if I run the application again I get only one
    usage of socket address exception when 'bind' of listener socket is called.
    This only occurs if a client is connected to application in the previous
    run. Remoting and socket are using different ports, I have also make sure
    that socket is closed and tcp channel is unregistered on application
    shutdown. Any ideas why listening port remains open ?, I am using .net
    framework 1.1.

    Regards

    Danish Ahmed
    Danish Ahmed, Apr 20, 2005
    #1
    1. Advertising

  2. Danish Ahmed

    Ivan Zuzak Guest

    Danish Ahmed wrote:
    > Hi,
    >
    > I am using .net remoting with tcp channel and a tcp socket for accepting
    > connections in a console application. When I run the application first time
    > everything works fine but if I run the application again I get only one
    > usage of socket address exception when 'bind' of listener socket is called.
    > This only occurs if a client is connected to application in the previous
    > run. Remoting and socket are using different ports, I have also make sure
    > that socket is closed and tcp channel is unregistered on application
    > shutdown. Any ideas why listening port remains open ?, I am using .net
    > framework 1.1.


    hi,
    the OS doesnt release the socket from that IP:pORT right after you close
    the application. it takes some time (a minute or two).

    so, look at the Channel and Formatter Configuration Properties in the
    MSDN, and find the "exclusiveAddressUse" property. this will solve your
    problem.
    Ivan Zuzak, Apr 21, 2005
    #2
    1. Advertising

  3. Danish Ahmed

    Danish Ahmed Guest

    Thanks for the reply Ivan, I set the 'exclusiveAddressUse' for both tcp
    channel and listener socket but the problem is still occurring, one thing I
    have notice is that this problem only occurs if some client connects to
    listener socket also if I remove to remoting code from the application
    listener socket starts working perfectly.



    Regards

    Danish Ahmed
    Danish Ahmed, Apr 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martijn Damen
    Replies:
    0
    Views:
    5,490
    Martijn Damen
    Jun 16, 2004
  2. Replies:
    1
    Views:
    3,545
    Roedy Green
    Aug 15, 2005
  3. Tiger
    Replies:
    5
    Views:
    966
    Dave Thompson
    May 1, 2006
  4. Bill Bush

    Remoting.Channels.Tcp

    Bill Bush, May 15, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    104
    Bill Bush
    May 15, 2004
  5. Colin Robbins

    TCP Listener on Windows XP

    Colin Robbins, Oct 7, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    242
    Colin Robbins
    Oct 9, 2003
Loading...

Share This Page