PC Review


Reply
Thread Tools Rate Thread

UDPClient.receive and network PORT issue?

 
 
=?Utf-8?B?WmFoaWQ=?=
Guest
Posts: n/a
 
      6th Dec 2004
Hi,

My application sends and receives data in UDP format (Byte arrays). I use a
UDPClient Listener to a specific IP address (User select but starts with
192.168.*.*) and Specific port (2004).

My application will work fine for a couple of hours or an average of 300
send and recieves of UDP datagram packets. Then, it appears that my
application sends data but the 3rd party application doesnt reply.

However after further investigation it appears that the 3rd party
application does send a reply packet but that my application doesnt detect
it. I have used Ethersniffer network packet sniffer to determine this.

What im trying to find out is that with my UDPClient do I have to clear it
or something.... is there a buffer that I need to clear.... What can I do to
be sure that the network side of things are fine. Im open to accept that it
could be a bug in my application but I need to be sure that its not to do
with the UDPClient.

I can continue to send packets but will not get any replies.

Any suggestions?

Thanks in advance.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxleCBZYWtobmluIFtNVlBd?=
Guest
Posts: n/a
 
      6th Dec 2004
How does your "3rd party application" send replies? Is it over UDP as well.
If it is, you'd need to have a listener on your side on appropriate port to
intercept those replies.

HTH... Alex

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com
www.opennetcf.org

"Zahid" wrote:

> Hi,
>
> My application sends and receives data in UDP format (Byte arrays). I use a
> UDPClient Listener to a specific IP address (User select but starts with
> 192.168.*.*) and Specific port (2004).
>
> My application will work fine for a couple of hours or an average of 300
> send and recieves of UDP datagram packets. Then, it appears that my
> application sends data but the 3rd party application doesnt reply.
>
> However after further investigation it appears that the 3rd party
> application does send a reply packet but that my application doesnt detect
> it. I have used Ethersniffer network packet sniffer to determine this.
>
> What im trying to find out is that with my UDPClient do I have to clear it
> or something.... is there a buffer that I need to clear.... What can I do to
> be sure that the network side of things are fine. Im open to accept that it
> could be a bug in my application but I need to be sure that its not to do
> with the UDPClient.
>
> I can continue to send packets but will not get any replies.
>
> Any suggestions?
>
> Thanks in advance.
>
>

 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      6th Dec 2004
The first thing that I'd do to try to figure out what's going on is write a
C/C++ version of my program using WinSock. Run that. Does it fail after
the same period of time? If so, you may have run against some type of OS
bug. I think it's more likely that the C program will never have a problem,
though. If that's the case, look at how you are releasing the resources
that you are allocating. Is the buffer that you're filling with the UDP
data being released? Are you allocating the socket every time a packet is
received? That would be a bad design and might leave you, eventually,
without a valid socket to open, for example.

Paul T.

"Alex Yakhnin [MVP]" <(E-Mail Removed)> wrote in message
news:0C0CC96A-33CC-4403-92FE-(E-Mail Removed)...
> How does your "3rd party application" send replies? Is it over UDP as
> well.
> If it is, you'd need to have a listener on your side on appropriate port
> to
> intercept those replies.
>
> HTH... Alex
>
> --
> Alex Yakhnin, .NET CF MVP
> www.intelliprog.com
> www.opennetcf.org
>
> "Zahid" wrote:
>
>> Hi,
>>
>> My application sends and receives data in UDP format (Byte arrays). I
>> use a
>> UDPClient Listener to a specific IP address (User select but starts with
>> 192.168.*.*) and Specific port (2004).
>>
>> My application will work fine for a couple of hours or an average of 300
>> send and recieves of UDP datagram packets. Then, it appears that my
>> application sends data but the 3rd party application doesnt reply.
>>
>> However after further investigation it appears that the 3rd party
>> application does send a reply packet but that my application doesnt
>> detect
>> it. I have used Ethersniffer network packet sniffer to determine this.
>>
>> What im trying to find out is that with my UDPClient do I have to clear
>> it
>> or something.... is there a buffer that I need to clear.... What can I do
>> to
>> be sure that the network side of things are fine. Im open to accept
>> that it
>> could be a bug in my application but I need to be sure that its not to do
>> with the UDPClient.
>>
>> I can continue to send packets but will not get any replies.
>>
>> Any suggestions?
>>
>> Thanks in advance.
>>
>>



 
Reply With Quote
 
=?Utf-8?B?WmFoaWQ=?=
Guest
Posts: n/a
 
      6th Dec 2004
Hi,

Here is some of my code:

'Globally held.
Public recDatagram As Byte()

Try
'Blocks until data recieved at port.
recDatagram = UDPClientListener.Receive(PacketReceivedFromIPEP)
Catch odEx As System.ObjectDisposedException
MsgBox("UDPClientListener is disposed: " & odEx.ToString)
'--
'--
End Try

Are you referring to the buffer "recDatagram" because ive not cleared it
anywhere so everytime a new datagram is received it gets copied into it. Im
assuming that whenever a new datagram is received the whatever was in
recDatagram is emptied and the new one copied into it, is that correct? What
should I do? Is the max size of this Byte array 1024 bytes?

The socket is allocated only once upon application startup.

What i was saying is that my listerner works fine for a few hours (average
300 datagrams sent and received) but suddenly it "seems" that it stops
working..... although the network packet sniffer shows a reply packet has
been sent by the 3rd party software.

All advice/assistance GREATLY appreciated.


"Paul G. Tobey [eMVP]" wrote:

> The first thing that I'd do to try to figure out what's going on is write a
> C/C++ version of my program using WinSock. Run that. Does it fail after
> the same period of time? If so, you may have run against some type of OS
> bug. I think it's more likely that the C program will never have a problem,
> though. If that's the case, look at how you are releasing the resources
> that you are allocating. Is the buffer that you're filling with the UDP
> data being released? Are you allocating the socket every time a packet is
> received? That would be a bad design and might leave you, eventually,
> without a valid socket to open, for example.
>
> Paul T.
>
> "Alex Yakhnin [MVP]" <(E-Mail Removed)> wrote in message
> news:0C0CC96A-33CC-4403-92FE-(E-Mail Removed)...
> > How does your "3rd party application" send replies? Is it over UDP as
> > well.
> > If it is, you'd need to have a listener on your side on appropriate port
> > to
> > intercept those replies.
> >
> > HTH... Alex
> >
> > --
> > Alex Yakhnin, .NET CF MVP
> > www.intelliprog.com
> > www.opennetcf.org
> >
> > "Zahid" wrote:
> >
> >> Hi,
> >>
> >> My application sends and receives data in UDP format (Byte arrays). I
> >> use a
> >> UDPClient Listener to a specific IP address (User select but starts with
> >> 192.168.*.*) and Specific port (2004).
> >>
> >> My application will work fine for a couple of hours or an average of 300
> >> send and recieves of UDP datagram packets. Then, it appears that my
> >> application sends data but the 3rd party application doesnt reply.
> >>
> >> However after further investigation it appears that the 3rd party
> >> application does send a reply packet but that my application doesnt
> >> detect
> >> it. I have used Ethersniffer network packet sniffer to determine this.
> >>
> >> What im trying to find out is that with my UDPClient do I have to clear
> >> it
> >> or something.... is there a buffer that I need to clear.... What can I do
> >> to
> >> be sure that the network side of things are fine. Im open to accept
> >> that it
> >> could be a bug in my application but I need to be sure that its not to do
> >> with the UDPClient.
> >>
> >> I can continue to send packets but will not get any replies.
> >>
> >> Any suggestions?
> >>
> >> Thanks in advance.
> >>
> >>

>
>
>

 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      6th Dec 2004
I don't see anything wrong, but you should examine the calls that you are
making, reread the help, etc.

My suggestion was in the previous message: try it in C.

Paul T.

"Zahid" <(E-Mail Removed)> wrote in message
news:75E715FB-0337-4807-B599-(E-Mail Removed)...
> Hi,
>
> Here is some of my code:
>
> 'Globally held.
> Public recDatagram As Byte()
>
> Try
> 'Blocks until data recieved at port.
> recDatagram = UDPClientListener.Receive(PacketReceivedFromIPEP)
> Catch odEx As System.ObjectDisposedException
> MsgBox("UDPClientListener is disposed: " & odEx.ToString)
> '--
> '--
> End Try
>
> Are you referring to the buffer "recDatagram" because ive not cleared it
> anywhere so everytime a new datagram is received it gets copied into it.
> Im
> assuming that whenever a new datagram is received the whatever was in
> recDatagram is emptied and the new one copied into it, is that correct?
> What
> should I do? Is the max size of this Byte array 1024 bytes?
>
> The socket is allocated only once upon application startup.
>
> What i was saying is that my listerner works fine for a few hours (average
> 300 datagrams sent and received) but suddenly it "seems" that it stops
> working..... although the network packet sniffer shows a reply packet has
> been sent by the 3rd party software.
>
> All advice/assistance GREATLY appreciated.
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> The first thing that I'd do to try to figure out what's going on is write
>> a
>> C/C++ version of my program using WinSock. Run that. Does it fail after
>> the same period of time? If so, you may have run against some type of OS
>> bug. I think it's more likely that the C program will never have a
>> problem,
>> though. If that's the case, look at how you are releasing the resources
>> that you are allocating. Is the buffer that you're filling with the UDP
>> data being released? Are you allocating the socket every time a packet
>> is
>> received? That would be a bad design and might leave you, eventually,
>> without a valid socket to open, for example.
>>
>> Paul T.
>>
>> "Alex Yakhnin [MVP]" <(E-Mail Removed)> wrote in message
>> news:0C0CC96A-33CC-4403-92FE-(E-Mail Removed)...
>> > How does your "3rd party application" send replies? Is it over UDP as
>> > well.
>> > If it is, you'd need to have a listener on your side on appropriate
>> > port
>> > to
>> > intercept those replies.
>> >
>> > HTH... Alex
>> >
>> > --
>> > Alex Yakhnin, .NET CF MVP
>> > www.intelliprog.com
>> > www.opennetcf.org
>> >
>> > "Zahid" wrote:
>> >
>> >> Hi,
>> >>
>> >> My application sends and receives data in UDP format (Byte arrays). I
>> >> use a
>> >> UDPClient Listener to a specific IP address (User select but starts
>> >> with
>> >> 192.168.*.*) and Specific port (2004).
>> >>
>> >> My application will work fine for a couple of hours or an average of
>> >> 300
>> >> send and recieves of UDP datagram packets. Then, it appears that my
>> >> application sends data but the 3rd party application doesnt reply.
>> >>
>> >> However after further investigation it appears that the 3rd party
>> >> application does send a reply packet but that my application doesnt
>> >> detect
>> >> it. I have used Ethersniffer network packet sniffer to determine
>> >> this.
>> >>
>> >> What im trying to find out is that with my UDPClient do I have to
>> >> clear
>> >> it
>> >> or something.... is there a buffer that I need to clear.... What can I
>> >> do
>> >> to
>> >> be sure that the network side of things are fine. Im open to accept
>> >> that it
>> >> could be a bug in my application but I need to be sure that its not to
>> >> do
>> >> with the UDPClient.
>> >>
>> >> I can continue to send packets but will not get any replies.
>> >>
>> >> Any suggestions?
>> >>
>> >> Thanks in advance.
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing port types : local port and Standard TCP/IP port programmer_not_admin Windows XP Print / Fax 3 28th Dec 2006 03:08 PM
map the public IP address and port number to a private IP address and port number Lutz Elßner Microsoft Windows 2000 RAS Routing 0 5th Nov 2005 07:58 PM
USB001 Virtual printer port vs USB002 Local port vs USB003 Virtual printer port ???? BobLeavitt Windows XP Print / Fax 1 26th Sep 2004 05:12 AM
I2C through PC parallel port, serial port and/or USB port - please help Adam DIY PC 22 29th Jun 2004 05:48 PM
Port 1033 (netinfo) port is open - what's it for and how do I close it? Neil Armstrong Windows XP Security 1 19th Sep 2003 06:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:23 PM.