Error 10057 WSAENOTCONN
Keywords: 10057
Question:
I setup my little LAN running Win95 for Tcp/Ip. It seems to be working because I can share disks across the network and I've used it for a week now without any problems. I downloaded the latest Internet Extender and I tried to do a simple program for talking to myself(127.0.0.1). I seem to be getting a 10057 error and I am not sure why? Am I missing something?Debug(1) AddExtender("wwwsk34I.dll") ;This is where I get a VALUE=>13567456 socket=sOpen() ;This is where I get a status of VALUE=>1 or "@TRUE" status=sConnect(socket,"127.0.0.1", "daytime") ;This is where I get a err of "0" err=wxGetLastErr() ;This is where I get a "WSock: Success" msg=wxGetErrDesc(err) Message("Winsock Error A %err%",msg) ;This is where I get an OK to continue while !sOK2Send(socket) counter=counter+1 ; do something endwhile ;This is where I get a "0" or @FALSE returned status=sSendString(socket,"Hello there!") ;This is where I get an err of VALUE=>10057 ;10057 WSAENOTCONN according to documentation? err=wxGetLastErr() msg=wxGetErrDesc(err) Message("Winsock Error A %err%",msg) sSendString(socket,@CRLF) data=sRecvLine(socket,256) Message( "Returned data is", data) sClose(socket) exitAnswer:
I suspect that your installation does not support the "daytime" socket. Try your ISP. I think the status=0 means it did not connect. Apparently a bug is that the sConnect does not set the lasterrorcode.Apparently your machines don't have the "daytime" port enables so maybe use that. Look at sListen and sAccept. One of them has the examples you need to get it working. I think in the examples I used ftp.
Ports go from 0 to 65535. Ports under something like 1000 are assigned to something or other. Ports over 1000 are used by the socket stuff. Pick a port under 1000 to use, and let the winsock stuff use the rest.
Most of them are for unix machines and for computer to computer communications where you control both side it does not matter too much, unless you land on one that windows uses.
Additional Questions:
I looked at sListen and sAccept, modified them and they worked like a charm:) I did notice that when I ran the "Listner Script",(datasocket=sAccept(listensocket,@TRUE) ; Block for a connection)the hard drive was being accessed every 1.5 seconds. I also noticed that when I started up the "Connector Script" that the Win95 "DialUp Window" appeared on the first pass and after I canceled it, I received my quote. After the first quote, the "DialUp Window" stopped appearing. Is there anything that I can do about the disk access and the "DialUp Window"?Answer:
Basically as you now have a LAN-based mini-internet, which automatically dials everytime you want internet access, that is toast and you have to do it manually.
- Hard drive light every 1.5 secs? More RAM ?
- Dialup box: Go to Control Panel/Internet/Remove autodial feature, and check on the CD. It might be the CD Auto-Insert check doing it.
Article ID: W12629Filename: Error 10057 WSAENOTCONN.txt