Search:
Type: Posts; User: beginner91
Search:
Search took 0.02 seconds.
-
March 20th, 2013, 06:31 AM
it is difficult to look up a document for every function especially when i don't know the functions needed. do you know of any fully completed examples/source code?
-
March 20th, 2013, 06:23 AM
so i'm missing the recvform function?
WSADATA wsaData;
SOCKET ListeningSocket, NewConnection;
SOCKADDR_IN ServerAddr;
int Port = 7171;
char recvbuff[1024];
int i, nlen;
-
March 20th, 2013, 06:11 AM
i thought i only needed to change this line:
ServerAddr.sin_addr.s_addr = INADDR_ANY;
-
March 20th, 2013, 05:58 AM
ok so i changed it to INADDR_ANY but i'm still getting the same error with listen
-
March 20th, 2013, 05:52 AM
but i understand. so INADDR_ANY is used in the server and INADDR_BROADCAST is used in the client
-
March 20th, 2013, 05:49 AM
sorry those links don't work for me
-
March 20th, 2013, 05:38 AM
i was told to use it. its a requirement
-
March 20th, 2013, 05:20 AM
not one that uses broadcast. its very difficult to find. if you could link any examples that would be great
-
March 20th, 2013, 05:07 AM
i have changed so much code so i started again.
here is the current code:
WSADATA wsaData;
SOCKET ListeningSocket, NewConnection;
SOCKADDR_IN ServerAddr;
int Port = 7171;
char...
-
March 20th, 2013, 04:27 AM
ok so the error i get with listen is 10045 which is:
i don't know how to solve this problem. description of the error doesn't help
-
March 19th, 2013, 08:44 AM
i assumed the code from the MSDN website would be right.
ok its set to true now
it is still displaying the error for setsockopt and now it is also displaying the error message from this code:
...
-
March 19th, 2013, 08:34 AM
that code is from MSDN. should it be true?
it is set to false at the start but then down a few lines it is set to true
is this a mistake?
-
March 19th, 2013, 08:30 AM
the code executes setsockopt and jumps into the else statement
this time the WSAGetLastError is 0
then it executes sendto and displays the WSAGetLastError which is still 10013
-
March 19th, 2013, 08:23 AM
the only change i made was moving some code around
void CSocketTestServerDlg::StartServer()
{
//---------------------------------------
// Declare variables
int iResult = 0;
WSADATA...
-
March 19th, 2013, 08:12 AM
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"...
-
March 19th, 2013, 07:55 AM
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
-
March 19th, 2013, 07:48 AM
ok i debugged it and went through each line
these are the lines that don't get executed:
WSADATA wsaData;
SOCKADDR_IN brdcastaddr;
char sbuf[1024];
-
March 19th, 2013, 07:27 AM
i never realized the line didn't get executed.
is it because its in the wrong place?
-
March 19th, 2013, 07:17 AM
final code:
void CSocketTestServerDlg::StartServer()
{
//---------------------------------------
// Declare variables
int iResult = 0;
WSADATA wsaData;
iResult =...
-
March 19th, 2013, 07:12 AM
that is the old setsockopt. sorry i just commented it out instead of removing it
i rewrote it when i added the error message code as you can see if you look at the code i posted and look for...
-
March 19th, 2013, 07:06 AM
please look at post #19
i edited the code and put in the line //----------- set socket ---------// so it is easy to find
-
March 19th, 2013, 07:01 AM
but i have done that:
setsockopt(m_serversocket, SOL_SOCKET, SO_BROADCAST, (char *) &bOptVal, bOptLen);
-
March 19th, 2013, 06:49 AM
yes i know what that error means
but i then started adding all the error messages so the problem was never solved. what do i need to do to fix it?
-
March 19th, 2013, 06:39 AM
ok i moved some code around. the problem was it wasn't reading a socket.
now the only error message displaying is the one that started this problem:
ERROR binding with server socket 10013
all...
-
March 19th, 2013, 06:30 AM
ok i fixed that error i was getting.
now a load of the error messages i added are displaying when u run the program:
getsockopt for SO_KEEPALIVE failed with error: 10038
setsockopt for...
|
Click Here to Expand Forum to Full Width
|