473,468 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

UDP using system.net.socket

I need UDP server and client components. Udpclient control is a no-no, it
doesnt do what I need and its buggy.
I'm looking for some sample code for setting up the system.net.socket as a
simple udp client/server as previously I only ever used components to do
this and never from microsoft windows api calls.
can anyone help please
thanks
Nov 17 '05 #1
4 2537
Hi Claire,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to implement a UDP client
using System.Net.Socket class. If there is any misunderstanding, please
feel free to let me know.

In you post, you mentioned you were using the UDP server and client
components. Could you let me know, which component you're using?

In .NET framework, we've provide a class named System.Net.Sockets.UdpClient
to provide simple methods for sending and receiving connectionless UDP
datagrams in blocking synchronous mode. So I don't think you need to
implement it yourself. You can check the following link for more
information to see if it meets your needs.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemnetsocketsudpclientclasstopic.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2
Hi Claire,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to implement a UDP client
using System.Net.Socket class. If there is any misunderstanding, please
feel free to let me know.

In you post, you mentioned you were using the UDP server and client
components. Could you let me know, which component you're using?

In .NET framework, we've provide a class named System.Net.Sockets.UdpClient
to provide simple methods for sending and receiving connectionless UDP
datagrams in blocking synchronous mode. So I don't think you need to
implement it yourself. You can check the following link for more
information to see if it meets your needs.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemnetsocketsudpclientclasstopic.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #3
Hi Kevin
Thank you for answering
I have read an article from an author contributing to The Code Project
http://www.codeproject.com/buglist/udpclientbug.asp
which describes bugs in the udpclient component.
Also, the udpclient comunications are synchronous and I prefer to work with
state engines and asynchronous notifications rather than allow a thread to
sit there through an uncontrollable timeout period.
My application will be realtime monitoring udp packets at upto 25ms
intervals. The data is pushed to me over a network.

Nov 17 '05 #4
Hi Claire,

Thanks for giving me the link from codeproject. Based on my research, this
is a known issue and has already been fixed in current version of .NET
framework.

Searching through the web, I'm sorry but I didn't find any example of how
to implement a UDP client using Socket. I think using a different thread to
monitor UDP packages will be much simpler than implementing a UDP client.

If you need to known how the UdpClient class was implemented in .NET, I
suggest you use the .NET Reflector to take a look. It can be downloaded
from the following link:

http://www.aisto.com/roeder/dotnet/

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #5

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

Similar topics

1
by: Dan Kelley | last post by:
I have 2 projects - 1 Winform project that sends Udp messages using the UdpClient class when a button is clicked, and a Console application that listens for these Udp messages. If I try to use...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
1
by: hamil | last post by:
I am having trouble using the TcpListener and TcpClient classes. At the end of this post is server code that runs, and a class whose purpose is described below. I need to know when the client...
2
by: Alpha | last post by:
Hi, I'm able to make connection to a server using socket connection. However, when I send a command string the server just ignores it. All command string needs to start with "0xF9" at Byte 0. ...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
1
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
1
by: verge | last post by:
hello everyone! how's it going? like everyone in here im in need of some help and good friendship along the way...take a look at this: //MODIFIED SO IT DEALS WITH WINDOWS FTP USING ACTIVE...
2
by: David G | last post by:
My company has a Webservice that is currently running in production. It is secured using SSL and clients are authenticated using X509 certificates. I am able to consume the Webservice methods in...
2
by: tcarasu | last post by:
We have two production servers under the DNS setup. We have installed our web services on both the servers. The web application is also installed in the same servers. When the web application tries...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
tracyyun
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.