R.Wieser
2017-04-04 09:59:16 UTC
Hello All,
I'm trying to get MSWinSock to listen at 127.0.0.1, but am, in the
end,unsuccessfull in doing so.
That is, I'm able to create a listening socket at the indicated IP (if I may
believe netstat -a -n) by binding the socket before listening to it, but
pointing my webbrowser to it doesn't seem to generate any of the events --
though it keeps waiting for the connection until I abort the script (upto
the browser own timeout ofcourse).
Can anyone tell me what I'm supposed to add/change ?
The code:
- - - - - - - - - - - - - - - -
Set socket = WScript.CreateObject("MSWinsock.Winsock", "wsock_")
socket.Close()
call socket.Bind(8081,"127.0.0.1")
socket.Listen
while true
sleep(1000)
wend
....
sub wsock_ConnectionRequest(reqestid)
socket.Close()
MsgBox("Request received, socket closed")
end sub
- - - - - - - - - - - - - - - -
Regards,
Rudy Wieser
I'm trying to get MSWinSock to listen at 127.0.0.1, but am, in the
end,unsuccessfull in doing so.
That is, I'm able to create a listening socket at the indicated IP (if I may
believe netstat -a -n) by binding the socket before listening to it, but
pointing my webbrowser to it doesn't seem to generate any of the events --
though it keeps waiting for the connection until I abort the script (upto
the browser own timeout ofcourse).
Can anyone tell me what I'm supposed to add/change ?
The code:
- - - - - - - - - - - - - - - -
Set socket = WScript.CreateObject("MSWinsock.Winsock", "wsock_")
socket.Close()
call socket.Bind(8081,"127.0.0.1")
socket.Listen
while true
sleep(1000)
wend
....
sub wsock_ConnectionRequest(reqestid)
socket.Close()
MsgBox("Request received, socket closed")
end sub
- - - - - - - - - - - - - - - -
Regards,
Rudy Wieser