It is currently Sun Oct 22, 2017 4:57 am

All times are UTC - 5 hours




 Page 1 of 1 [ 9 posts ] 
Author Message
 Post subject: Network VMK 8 - UDP Client
PostPosted: Fri Jul 22, 2011 5:27 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In this video I wrap up the missing component that is needed to do UDP communication across the network. We finally see how to initialize the _socketAddress member variable.


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Sun Jul 24, 2011 10:01 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
I just finished the code and I do not see any visible bugs; however when I do run the code for the UPD - Server/Client I am not getting the expected results as I do when I run it in TCP Mode. I am providing a screen shot of the cmd results as well as the source code. I tripple checked all the code; and I even created a brand new project and started the from the beginning of the Network Series, and I am still getting the same result. I know it is not my firewall too. From the looks of things, It is either within the receiveString() function, one of the three UDP functions within NetworkManager, or it has to do with the static init string.

The image is displayed with servers-clients: left to right and the top row is TCP as bottom is UDP:
Image
As you can see from the screenshot. When using TCP, the server waits for the client then the client connects and sends the data, the server responds and sends confirmation, and the client displays it.

With UDP this is not the case. The server waits for the client, the client connects to the server and sends its data, however the server is not receiving the data, and never sends its confirmation back to the client.

Any help in finding out why this is happening will be appreciated. Thank You In Advance!


Last edited by skilz80 on Sun Jul 24, 2011 10:19 am, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Fri Jul 29, 2011 4:48 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Thanks for sending me your source code. I compiled it on my computer and ran your code. Everything works fine on my computer so that tells me that your code is correct, however something is wrong with your OS settings. It must be blocking your UDP port from communicating.

Give this a try: Create a new VS project and import your source files. Name the output of your project to something other than NetworkManager. Build and run. You should see windows prompt you if you want to allow this program access over the network. Click yes.

If that doesn't work you will have to drill into the settings to set your ports up manually under Windows. Under Windows 7, you'll find these options inside Control Panel > Windows Firewall > Allowed Programs


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Fri Jul 29, 2011 5:36 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Ok, lets see, I am running windows vista 32bit ultimate service pack 2, and i am using windows firewall along with Eset Smart Security4 with its firewall. I am also behind a router by netgear. I have allowed ports in both firewalls and even portward/triggered my router. I even tried disabling both firewalls and still same response. Ill try with a new project and see what happens.


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Fri Jul 29, 2011 6:07 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Ok i created a new project and named it MyServer I even changed the name of the class to MyServer as well, I disabled both Windows, and Esets firewall, I even changed my router's options to DMZ mode, so I don't have to worry about port-forwarding/triggering. I still get the same results

the tcp works, but the udp doesn't


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Fri Jul 29, 2011 11:04 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
I read up on how the pc uses tcp and udp, through firewalls and routers, and it seems that if using the
same port, it will open and close the port for both in nearly the same manner. What I am not understanding
is the fact that the one is working and not the other. Another fact is I am hosting a voice server namely,
ventrilo, and I am using wamp to host my own website/server from my home pc. This tells me that my
port fowarding for the http port which is default to 80 for wamp, and for vent their default is 3784 is working
correctly. With this I set up a new port forwarding in my router to allow access for the ports 17101- 65534
just for this specific app. I also went into both firewalls and made exceptions for this program as well, and
I am still getting the same result. I am stumped at this point. Any help would be wonderfull.


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Sat Jul 30, 2011 2:34 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Finally, I got it to work, but I still don't know what was causing it. It was one of these 5 items.
UAC, Windows Firewall, Eset's Smart Security 4 Firewall,
Microsoft's Security Essentials, or Esets Smart Security Antivirus.

Even though it isn't safe, I dissabled all of them, Just for this purpose. This tells me that from here on out
if I am testing for UDP i have to disable everything. If I am using TCP, i can leave it all on. I hope this
will help anyone else who may run into this sort of problem.

Maybe If I dig a little deeper I can norrow it down to which program or service is causing it, and see if I can
add an exception, so I don't have to turn everything off while debugging.


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Sat Jul 30, 2011 5:40 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
I did some more digging and narrowed it down to a single application and a single option within that application.
The application that was causing the block is Eset's Smart Security 4.
If you do not have this then this doen't pertain to you directly, but may help you to configure your own personal firewall
if you are having similar troubles as to this one.

On Esets main page, under setup left side of page select personal firewall, then on right side of page select
advanced personal firewall setup... a new window will pop up and on the left side of the page you will need to select
Application Modification decection and on the right side of page make sure that there is not a check box in either box, or try to add your application to the list here. This should resolve the issue with UDP. There is no issue with TCP


Offline
 Profile  
 
 Post subject: Re: Network VMK 8 - UDP Client
PostPosted: Sat Jul 30, 2011 2:19 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Great investigation work, I'm glad you were able to find the cause of the problem!


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron