473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can I use one UdpClient object for both send and receive operation

I am looking into UdpClient sample code from MSDN where one UdpClient object
used for both send and receive operation.

Please take a look at the link below
http://msdn.microsoft.com/library/de...classtopic.asp

I can't make similar to this code work. The udpClient.Receive method waits
for timeout seconds and then throws exception "timeout expired".

If however I use different UdpClient objects, one for send and another for
receive then everything works fine. And this make sense to me since when we
used Winsock in VC 6.0 projects, we always created two sockets: one for send
and another for receive operations.

Can anyone clarify whether it is possible to use one UdpClient object for
both send and receive operations. If yes could you provide simple example in
C#.

Thank you
Nov 17 '05 #1
0 1215

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

Similar topics

4
by: Morten Overgaard | last post by:
Hi I'm listening on the SysLog port (514) through UDP. The problem is that I am not receiving anything nut I know that i get messages on the port. When I use KIWI to listen on the same port via...
2
by: Serdar C. | last post by:
im trying to write a really simple program that communicates with udp packets between server and client apps... but i cant receive (or send?) any data from any of the applications.. what am i doin...
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...
1
by: Steve | last post by:
Please take a look at the simple code segment below and advise me what is wrong. According to the help and examples I've seen it should work unless I misunderstand something. The problem is...
2
by: Emilio | last post by:
Question about UdpClient sample ' This constructor arbitrarily assigns the local port number. Dim udpClient As New UdpClient() Try udpClient.Connect("www.contoso.com", 11000) ' Sends a...
6
by: swartzbill2000 | last post by:
If I do this: Dim receiver As New UdpClient() Then the documentation says the system will pick a port. How can I extract the chosen port number from receiver? Bill
1
by: pavel.orehov | last post by:
Hi, I am using UDPClient with C# to communicate with other peer. I have the problem that when I send a lot of data to the remote peer I get an error "An operation was attempted on something...
0
by: matt | last post by:
Hi I built a class to poll an app on a udp port using the sync methods which worked fine. I've since changed to using beginreceive and now the poll works but I don't receive the response from...
7
by: | last post by:
I have the following program using System; using System.Collections; using System.Net.Sockets; using System.Net; using System.IO; public class Test { public static void Main(string s) {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
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...
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...

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.