If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: getting a binding error in server program

Originally Posted by beginner91

well i don't what the problem is. those are the only lines that don't get executed and then i reach the error message

Well, let's begin from the very begin. Please, answer the following questions:
1. What is the reason of the error you got?
2. What is recommended to fix this error?
3. Did you implement this recommendation?
4. If you did - then where and how?

Re: getting a binding error in server program

the reason for the error is from the 10013 error which is:
An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for "sendto" without broadcast permission being set using setsockopt(SO_BROADCAST).

but my setsockopt is using SO_BROADCAST.

i have moved the setsockopt code above the sendto code
the code executes setsockopt and jumps into the else statement
this time the WSAGetLastError is 0
then it executes sendto and displays the WSAGetLastError

Re: getting a binding error in server program

Again:
you must read the documentation to understand what value you need and in which case!
So, if you need to set a SO_BROADCAST option it must be TRUE, if instead you need to remove this option then FALSE.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.