473,807 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set SocketOptionNam e.ReuseAddress given a TcpChannel object.

I'm using Remoting to implement a client/server. I recently discovered that
I cannot connect a second instance client because it is trying to reuse the
port and appearently the socket isn't setup for address reuse. Upon creating
the TcpChannel I get the following exception:
"An unhandled exception of type 'System.Net.Soc kets.SocketExce ption'
occurred in system.runtime. remoting.dll
Additional information: Only one usage of each socket address
(protocol/network address/port) is normally permitted"
The channel is created like this:

BinaryServerFor matterSinkProvi der provider = new
BinaryServerFor matterSinkProvi der();
provider.TypeFi lterLevel = TypeFilterLevel .Full;
IDictionary props = new Hashtable();
props["port"] = 8081;
TcpChannel channel = new TcpChannel(prop s, null, provider);
ChannelServices .RegisterChanne l(channel);

Now I can't figure out how to gain access to the Socket object so I can call
SetSocketOption on it.

I tried adding
props["exclusiveAddre ssUse"] = false;
but I don't think that's the same thing as the ReuseAddress socket option
(it didn't work).

If I don't specify a port to the TcpChannel constructor, it only makes a
one-way connection (i.e. the remotable object cannot callback the clients).
Sep 20 '06 #1
0 3163

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1462
by: Aiden Fung | last post by:
In TcpChannel, the StartListening and StopListening methods require a data object type argument for initializing the channel state. Does anyone know what this data object type is? Thanks in advance, Aiden
2
3050
by: Ahmet AKGUN | last post by:
Hi; I am trying to make a server that handles db connection pool. Clients use TcpChannel to make a call to this server and get one database connection (OleDbConnection) from pool. But when I try to connect to server using TcpChannel, I get this message "Only one usage of each socket address (protocol/network adress /port)" is normally permitted.
1
9600
by: Ahmet AKGUN | last post by:
Hi All; I have one server to which clients are connected to via TcpChannel. I start server on one host and establish a client connection from another host via tcpchannel. On client, using activators, I try to invoke one function on server side using channel After first successfull fucntion invoke, I unplug ethernet cable on server side and
0
1282
by: Michi Henning | last post by:
The C# doc lists all the available SocketOptionName enumerators (on the SocketOptionName help page), but there doesn't appear to be a list of which option goes with what socket option level. It would be nice to have such a list. (Without it, I have to keep switching back to the Win32 API doc, which provides such a list.) From the code example on the SocketOptionLevel help page, I can see that SocketOptionName.SendTimeout goes with...
0
979
by: Risen | last post by:
Hi,all, How to declare a TCPChannel Object and implement it? In MSDN I found code and try it In IDE,but it have some error,so can not compile it! Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not found this namespace or type £¿£¿
2
3331
by: Risen | last post by:
Hi,all, How to declare a TCPChannel Object and implement it? In MSDN I found code and try it In IDE,but it have some error,so can not compile it! Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not found this namespace or type £¿£¿
2
10655
by: Sagaert Johan | last post by:
Hi When the remoting server starts and the client immediate begins calling the remote object on the server no problems. But when the client does not need to access the remote object for some time the connection seems to be broken on the next attempt to do a call to the remote object on the server. (i need to restart the server application to get it working again ). So it appears if the remoting connection is idle for some time (...
0
2978
by: faculaganymede | last post by:
C# Gurus, I am trying to understand more about TcpChannel and remoting. 1. Do TcpChannel functions wrap around the socket functions (i.e. calls the socket functions internally)? 2. If I have a server app that is set up using socket functions, can I set up a TcpChannel client app to communicate with that server? Would they know how to communicate? Or, do I have to set up the server app using TcpChannel functions also? 3. If I have...
0
1376
by: =?Utf-8?B?RGlvZ28gQWx2ZXM=?= | last post by:
Greeting Nicholas, Thanks for your answer but I'm pretty new in this stuff.... I already have a class that inherits the MArshalByRefObject and I use it to get answers from the server like this: On the client windows form I have: public ServerComm.Server obj = new ServerComm.Server(); public TcpChannel chan = new TcpChannel();
0
9720
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10626
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.