Toon posts:

WSAEWOULDBLOCK bij VPN

Pagina: 1
Acties:
  • 137 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb een vpn verbinding en nu wil ik contact met een SAP-server maken maar nog VOOR het inlogscherm krijg de volgende melding: WSAEWOULDBLOCK

weet iemand hier iets op.

  • maxjuh
  • Registratie: November 2004
  • Laatst online: 19-03-2025
Op GoT verwachten we dat je eerst zelf gaat zoeken.

http://www.google.nl/sear...&btnG=Google+zoeken&meta=

geeft bijvoorbeeld:
2.8 - Winsock keeps returning the error WSAEWOULDBLOCK. What's wrong with my program?

Not a thing. WSAEWOULDBLOCK is a perfectly normal occurrence in programs using non-blocking and asynchronous sockets. It's Winsock's way of telling your program "I can't do that right now, because I would have to block to do so."

The next question is, how do you know when it's safe to try again? In the case of asynchronous sockets, Winsock will send you an FD_WRITE message after a failed send() call when it is safe to write; it will send you an FD_READ message after a recv() call when more data arrives on that socket. Similarly, in a non-blocking sockets program that uses select(), the writefds will be set when it's okay to write, and the readfds will be set if there is data to read.

Note that Win9x has a bug where select() can fail to block on a nonblocking socket. It will signal one of the sockets, which will cause your program to call recv() or send() or similar. That function will return WSAEWOULDBLOCK, which can be quite a surprise. So, a program using select() under Win9x has to be able to deal with this error at any time.

This gets to a larger issue: whenever you use some form of nonblocking sockets, you have to be prepared for WSAEWOULDBLOCK at any time. It's simply a matter of defensive programming, just like checking for null pointers.

Verwijderd

klink als een firewall blokkade.

en als je beetje crea bent met de volgende code:

void main(int argc, char* argv[])
{
int ret;
WSADATA wsaData;
WSAStartup(MAKEWORD(2,2), &wsaData);

// mark the socket with non-blocking
SOCKET listener = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0,
WSA_FLAG_OVERLAPPED);
if ( listener == INVALID_SOCKET) {
cout <<"WSASocket() failed with error " << WSAGetLastError() <<endl;
return;
}


SOCKADDR_IN InternetAddr;
InternetAddr.sin_family = AF_INET;
InternetAddr.sin_addr.s_addr = htonl(INADDR_ANY);
InternetAddr.sin_port = htons(12345);

ret = bind(listener, (PSOCKADDR) &InternetAddr, sizeof(InternetAddr));
if (ret == SOCKET_ERROR) {
cout<<"bind() failed with error: " << IntToStr(
WSAGetLastError()).c_str() <<endl;
return;
}
if (listen(listener, 5) == SOCKET_ERROR) {
cout<< "*** listen() failed with error "<< WSAGetLastError() <<endl;
return;
}

struct sockaddr cc; int ccsize=sizeof(cc);
SOCKET accept = WSAAccept(listener, &cc, &ccsize, NULL, 0);
if (accept == INVALID_SOCKET) {
cout<<"socket error"<< WSAGetLastError() <<endl;
}

ret=WSACleanup();
assert(ret!=SOCKET_ERROR);

}

[ Voor 95% gewijzigd door Verwijderd op 19-12-2007 11:02 ]


Verwijderd

Topicstarter
ik heb al heel veel gezocht naar een oplossing maar ik had het niet vermeld. alle firewalls staan uit.

die code die boven dit staat. waar moet ik die inzetten?

  • Koffie
  • Registratie: Augustus 2000
  • Laatst online: 14-03 19:27

Koffie

Koffiebierbrouwer

Braaimeneer

Ko op zeg, zo starten we hier geen topic :/
Het is je al meer dan genoeg verteld (zelfs per mail) dat wij een duidelijk inzet van je verwachten.

Tijd voor een nieuwe sig..


Dit topic is gesloten.