I'm attempting to set up at UDP server in unicast mode, where
10.1.16.25 is the remote machine. Below is the error being thrown
when binding the socket. What am I doing wrong?
System.Net.Sockets.SocketException
"The requested address is not valid in its context"
Socket socket = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
socket.SetSocketOption(
SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer,
75000000); // 75 MB
socket.SetSocketOption(
SocketOptionLevel.Socket,
SocketOptionName.SendBuffer,
1472);
EndPoint receiveEndPoint = new IPEndPoint(
System.Net.IPAddress.Parse("10.1.16.25"),
socketConfig.Port);
socket.Bind(receiveEndPoint); 4 6826
On Thu, 27 Mar 2008 19:07:05 -0700, O.B. <fu******@bellsouth.netwrote:
I'm attempting to set up at UDP server in unicast mode, where
10.1.16.25 is the remote machine. Below is the error being thrown
when binding the socket. What am I doing wrong?
You're trying to bind your local socket to a remote address.
If you want to specify a remote address to be used as the default
destination for the UDP socket, use Connect(), not Bind().
By the way...IMHO, you shouldn't be messing with the socket buffer sizes
unless you have already gotten everything else working, you know exactly
what you're doing, _and_ you have run into some problem that requires you
to change the default buffer sizes.
Pete
On Mar 27, 10:07 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 27 Mar 2008 19:07:05 -0700, O.B. <funkj...@bellsouth.netwrote:
I'm attempting to set up at UDP server in unicast mode, where
10.1.16.25 is the remote machine. Below is the error being thrown
when binding the socket. What am I doing wrong?
You're trying to bind your local socket to a remote address.
If you want to specify a remote address to be used as the default
destination for the UDP socket, use Connect(), not Bind().
But that would require the remote connection to be Bound to that port
to accept connections. Here is the dilemma. We have a user that has
other commercial software that is only capable of running their
sockets as client UDP broadcast connections on a fixed port. On our
end, the user wants the ability to open two UDP servers both on the
same port, but for each one to filter based on the IP that is sending
data. I was hoping that it would be possible to do this in the
connection setup rather than having our asynchronous receive callback
do the filtering.
With that said, what is the point of binding to a specific address if
it isn't allowed?
By the way...IMHO, you shouldn't be messing with the socket buffer sizes
unless you have already gotten everything else working, you know exactly
what you're doing, _and_ you have run into some problem that requires you
to change the default buffer sizes.
We started off with defaults and lost too many packets. 75 MB ended
up being a good number. Most of our machines are running with 4 GB or
more of memory, so it isn't an issue.
On Sat, 29 Mar 2008 20:59:59 -0700, O.B. <fu******@bellsouth.netwrote:
Each time the receive callback is invoked, the code checks to see how
full the buffer is. When it is close to 100%, we start noticing data
not being received.
How do you check to see how full the buffer is?
Yes, it does happen. However, when more than 25% of the packets are
getting lost, we start looking at the network for issues.
25% is high, yes. Still, that doesn't mean that it's simply a buffer size
issue.
Thanks again for your help. I think we're good to go for now.
Somehow I suspect not. But if you're satisfied with the solution, I guess
that's your perogative. Good luck.
Pete
On Mar 29, 7:08 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sat, 29 Mar 2008 20:59:59 -0700, O.B. <funkj...@bellsouth.netwrote:
Each time the receive callback is invoked, the code checks to see how
full the buffer is. When it is close to 100%, we start noticing data
not being received.
How do you check to see how full the buffer is?
Yes, it does happen. However, when more than 25% of the packets are
getting lost, we start looking at the network for issues.
25% is high, yes. Still, that doesn't mean that it's simply a buffer size
issue.
Thanks again for your help. I think we're good to go for now.
Somehow I suspect not. But if you're satisfied with the solution, I guess
that's your perogative. Good luck.
Pete
Well, doing a Socket.Connect() on a UDP socket causes a Socket.Bind()
to throw a socket exception. So it is not possible to Bind on a local
address in UDP *and* use Connect to specify a remote address at the
same time. Oh well ... that's life. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Phil |
last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server:
class HelloWorld:
_reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}"
_reg_desc_ = "Python Test COM Server"...
|
by: Nathan Sokalski |
last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database
capabilities of ASP and IIS. I am probably using some incorrect settings,
but I am not sure what they are. Here is what...
|
by: Ken Lindner |
last post by:
I have a need to become familiar with SQL Server 2000 for work.
Needless to say I am new to SQL Server any version, but not IT in
general. My employer has provided me with the SQL Server 2000...
|
by: Philip Trim |
last post by:
General Brief:
3 SQL Servers as MS SQL Server 2000 Standard Edition with Service
Pack 3
All using FTP for snapshots
All Servers are both Publishers and Distributors.
Server A has the correct...
|
by: Grim Reaper |
last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have
never setup a server from the beginning, so I am a little new at creating
server groups.
Alright, I am trying to create...
|
by: Mike |
last post by:
Hi,
I am strugling with a simple problem which I can't seem to resolve.
I have an asp.net page which contains a server-control (flytreeview,
which is a kind
of a tree to be exact).
The tree is...
|
by: Jobs |
last post by:
Download the JAVA , .NET and SQL Server interview with answers
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of...
|
by: Developer |
last post by:
Hello All,
i have recently installed VS2005 and was trying to install SQL sever
2000.
I have Win XP' SP2. But when I tried installing, it only installed
client tools and not the database.
Can...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |