flat assembler
Message board for the users of flat assembler.

Index > Windows > sockets question

Author
Thread Post new topic Reply to topic
bcdsys



Joined: 04 Aug 2008
Posts: 41
bcdsys 04 Dec 2008, 04:22
I'm coding socks proxy server and I need to recv on 2 ports, and send to other dest when data arrives. What is best way to do this? Is there way to have function called when data arrives on socket, so I can recv and send to other dest?
Post 04 Dec 2008, 04:22
View user's profile Send private message Reply with quote
Pirata Derek



Joined: 31 Oct 2008
Posts: 259
Location: Italy
Pirata Derek 04 Dec 2008, 12:38
Use the WSAAsyncSelect function (on WSOCK32.INC)
It's usefull to recive a message on a window when socket events occur,
for example when a connection is closed or when you recive some packets (data).

The parameters are:
1) the Socket
2) The handle of the windows (for example a DialogBox)
3) A message to be receved when the evet occurs (dword)
4) the events

Example: invoke WSAAsyncSelect,[socket],[handle],100h,FD_READ

for more details search with GOOGLE: WSAAsyncSelect Function()

You can find and download my network tool (source code) that work like a server, chat and like a remote executor, here (scroll down the page):
http://board.flatassembler.net/topic.php?t=9369&start=20
Post 04 Dec 2008, 12:38
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.