On Mar 4, 5:50 pm, Nelson Bolyard <[EMAIL PROTECTED]>
wrote:
> D3|\||\|!$ wrote, On 2008-03-04 04:19:
>
> >> selfserv uses blocking sockets.
>
> > I tried turning the PR_SockOpt_Nonblocking given at the below link to
> > PR_TRUE to see if the clien't behaviour changed but now the PR_Accept
> > function is throwing PR_WOULD_BLOCK_ERROR(The operation would have
> > blocked). How do I circumvent this..??? Kindly suggest a solution to
> > my problem...
>
> This is exactly the expected behavior of a non-blocking socket.
> Again, I suggest you study about non-blocking sockets.


I did so again but I again realized that I know non-blocking sockets
sufficiently(atleast for my purpose)... :-)


> I'm surprised that you changed selfserv and not tstclnt, given that the
> results you reported before seemed to show that selfserv was working OK
> and your problem was with tstclnt.

Actually I wrote a common bind-configure function to be shared between
the client and the server so modifying the bind-configure function
automatically reflected into the other. Plus I tested the "C++"
version of my client with my "C" server(which was working properly,
happily...). I omitted the fact for brevity's sake..

I tried running a finite loop on the client's connect function like:
******************************************************************************************************
    for (int i =0; ((i<10,000) && (err_status != PR_SUCCESS)); i++) {

        // Try to connect to the server
        err_status = PR_Connect(rendezvous_sock, &addr,
PR_INTERVAL_NO_WAIT);
   }

    if (err_status != PR_SUCCESS) {

        err_code = PR_GetError();
    }
******************************************************************************************************
Then I put the server into non-blocking mode and called the accept(I'm
not mentioning the common socket configuration steps in between). The
accept function returns a valid PRFileDesc structure representing the
newly accepted connection.

The client on the other hand(whether in blocking or non-blocking
mode), tries to connect for sometime, then the compiler throws up a
memory access violation error in ntdll.dll(I'm developing the
application on windows platform) indicating that some pointer access
has gone awry... Sorry!!! I forgot to mention this detail earlier
while starting the thread...
The only pointers I have used in the PR_Connect function call are
those of the listening socket and the PRNetAddr structure holding the
address...

Could you kindly tell me where am I making the mistake...??? I'm
simply helpless!!!



Warm Regards,
D3|\||\|!$
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to