News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Active computer on a WLAN

Started by Farabi, July 22, 2010, 03:06:25 AM

Previous topic - Next topic

ecube

oh woops, haha you're right, sorry it's late here.

oex

:lol np late here also it could just as easily been me

It seems to me the error is somewhere around here:
         mov ecx, add_table
         mov eax, adcnt; [ecx]
         mov ecx, 16
         mul ecx
;         add eax, 4
but I am still checking what's going onwith this code
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

what i know about winsock, you could scratch on the back of a matchbook cover - and still have room to do your taxes
but - it looks like you might be using "invoke closesocket,a.sock", even if the socket wasn't opened ? (as in the case of error)

oh - and
         mov ecx, add_table
         mov eax, [ecx]
         mov ecx, 16
         mul ecx

could be
         mov eax, add_table
         mov eax, [eax]
         shl eax,4

ecx and edx don't get trashed
         

oex

Quote from: dedndave on July 22, 2010, 04:33:38 AM
what i know about winsock, you could scratch on the back of a matchbook cover - and still have room to do your taxes
but - it looks like you might be using "invoke closesocket,a.sock", even if the socket wasn't opened ? (as in the case of error)

*I think* this can be resolved:

      invoke closesocket,a.sock
      .endif

Although further error checking is needed in/after fConnectToUrl.... I'm not sure what PERR does
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

yah - that's kind of what i was thinking, i thought you needed an "else", first

oex

Quote from: dedndave on July 22, 2010, 04:38:30 AM
yah - that's kind of what i was thinking, i thought you needed an "else", first

No it's opening multiple sockets in a loop.... it wants to close each socket if !Socketerror.... If there is a socket error it's probably that no socket was created in fConnectToUrl

Also a likely cause of not quiting is no WSACleanup function call:
"An application must call the WSACleanup function for every successful time the WSAStartup function is called"

http://msdn.microsoft.com/en-us/library/ms742213(v=VS.85).aspx
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Farabi

I reduced the search to 3 and it quit ok too, I dont know where is my mistake.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Farabi

PERR is for the error message

PERR PROC uses ebx edi esi ;, _API : DWORD
LOCAL szMsgBuf[500]:BYTE

INVOKE GetLastError
mov ebx, eax
INVOKE FormatMessage, \
FORMAT_MESSAGE_FROM_SYSTEM,\
NULL, \
ebx, \ ;Message Id
LANG_NEUTRAL + SUBLANG_DEFAULT*1024, \ ;Message language
ADDR szMsgBuf, \ ;Buffer to store message
500, \ ;Buffer size
NULL ;No more arguments
INVOKE MessageBox, NULL, ADDR szMsgBuf, NULL, MB_OK

;INVOKE ExitProcess, -1

ret

PERR ENDP
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

oex

I'm currently rewriting the code.... I'll get it sorted asap, just it's quite late so I'm slow :lol There are a couple of issues (as above) I've found, WSACleanup, the sockets issue Dave identified and the mov eax, [ecx] bit
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Farabi

oh it seems connect wait too long for an inactive IP, anyone know how to set the time out limit?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Farabi

I done it, I used multiple thread which had 100ms delay each creation so it not accessing the same address at the same time.
I can check how many computers active on a WLAN server, I wonder if I could know their position by calculating the message sent back to me  :green
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"