CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: beginner91

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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?
  2. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    so i'm missing the recvform function?


    WSADATA wsaData;
    SOCKET ListeningSocket, NewConnection;
    SOCKADDR_IN ServerAddr;
    int Port = 7171;
    char recvbuff[1024];
    int i, nlen;
  3. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    i thought i only needed to change this line:

    ServerAddr.sin_addr.s_addr = INADDR_ANY;
  4. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    ok so i changed it to INADDR_ANY but i'm still getting the same error with listen
  5. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    but i understand. so INADDR_ANY is used in the server and INADDR_BROADCAST is used in the client
  6. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    sorry those links don't work for me
  7. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    i was told to use it. its a requirement
  8. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    not one that uses broadcast. its very difficult to find. if you could link any examples that would be great
  9. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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...
  10. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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
  11. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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:

    ...
  12. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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?
  13. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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
  14. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    the only change i made was moving some code around


    void CSocketTestServerDlg::StartServer()
    {
    //---------------------------------------
    // Declare variables
    int iResult = 0;
    WSADATA...
  15. Replies
    66
    Views
    49,342

    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"...
  16. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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
  17. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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];
  18. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    i never realized the line didn't get executed.
    is it because its in the wrong place?
  19. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    final code:


    void CSocketTestServerDlg::StartServer()
    {
    //---------------------------------------
    // Declare variables
    int iResult = 0;
    WSADATA wsaData;
    iResult =...
  20. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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...
  21. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    please look at post #19
    i edited the code and put in the line //----------- set socket ---------// so it is easy to find
  22. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    but i have done that:

    setsockopt(m_serversocket, SOL_SOCKET, SO_BROADCAST, (char *) &bOptVal, bOptLen);
  23. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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?
  24. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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...
  25. Replies
    66
    Views
    49,342

    Re: getting a binding error in server program

    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...
Results 1 to 25 of 33
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured