flat assembler
Message board for the users of flat assembler.
Index
> Windows > Winsock Trouble.. |
Author |
|
revolution 17 Dec 2011, 12:51
RTFM
TFM wrote: If no incoming data is available at the socket, the recv call waits for data to arrive unless the socket is nonblocking. In this case, a value of SOCKET_ERROR is returned with the error code set to WSAEWOULDBLOCK. The select, WSAAsyncSelect, or WSAEventSelect calls can be used to determine when more data arrives. |
|||
17 Dec 2011, 12:51 |
|
Overflowz 17 Dec 2011, 12:54
revolution
I know that but: 1) It's running to another thread. Why thread are pausing my program ? 2) How to use blocking sockets ? I have no idea. |
|||
17 Dec 2011, 12:54 |
|
revolution 17 Dec 2011, 13:02
Overflowz wrote: I know that but: Overflowz wrote: 1) It's running to another thread. Why thread are pausing my program ? Overflowz wrote: 2) How to use blocking sockets ? I have no idea. |
|||
17 Dec 2011, 13:02 |
|
Overflowz 17 Dec 2011, 13:26
I posted the code, which are running in different thread and I have problem only there, not else anywhere, so, I said thread's recv is waiting data until it receives and by that time, program execution is passed to only that thread, I mean, program waits that thread and then continues execution (I hate English).
and what TFM mean I really don't know. Be more understandable please. |
|||
17 Dec 2011, 13:26 |
|
revolution 17 Dec 2011, 13:44
So after the thread is created does you code print "[+] Packets sent!"? And after printing "[+] Packets sent!" your code loops around and waits on another recv
Code: @@: invoke recv,[hSock],dstbuff,1024,0 ;wait here also invoke send,[rSock],dstbuff,eax,0 I suspect you are looking in the wrong place, and that is why you need to post all the code, or at the very least a working example showing the problem. Give us something we can compile and run to see what is happening. Help us to help you. The reason I suspect you are looking in the wrong place is because a single thread waiting on a blocking API call cannot "pause you whole program". The other threads will continue to run normally. You have to find out where the other threads are and what they are waiting on. |
|||
17 Dec 2011, 13:44 |
|
Overflowz 17 Dec 2011, 14:03
revolution
I found problem, sorry, problem is in loop. I'm creating thread in loop even if threadproc is not receiving data.. Thank you |
|||
17 Dec 2011, 14:03 |
|
Overflowz 17 Dec 2011, 17:46
Not going to open another thread, just asking here.. How should I set option to socket to be Non-Blocking ? Should I use ReadFile/WriteFile instead of recv/send ?
|
|||
17 Dec 2011, 17:46 |
|
Overflowz 18 Dec 2011, 08:45
Never mind, I found. It is done with ioctlsocket API.
|
|||
18 Dec 2011, 08:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.