FASt Server - Win32 Socket Library and Tutorial ....

Started by James Ladd, January 15, 2005, 02:41:51 AM

Previous topic - Next topic

James Ladd

hehehe, my name is James.
Its just funny that Hutch calls me that yet most people have an alias here :)

hutch--

James,

Its a form of brain lock I have, I almost exclusively remember the first handle that connects and it sticks forever. My head tends to relate to people more than nicks so a name registers and stays where nicks often don't.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

James Ladd

All,
Sorry there isnt another download yet. Been hard at work doing another framework/approach for our application
development. More code this week - promise.
Rgs, striker.

AeroASM

This is a framework, right? So users of my plugin will have to get the framework, run it, and install my plugin into it? Is it possible in any way to "statically link" the framework into my app so I only have distribute my app?

James Ladd

AeroASM,

Thanks for the good question.

The answer is yes you will be able to statically link FAStServer into your own applications.

FAStServer is a DLL and a LIB right now! The EXE just links to the DLL statically and calls it.

You will still need to write a plug-in as this is the only mechanism I have coded for calling your code back to do some
work. When you call the FAStServer API (DLL) you tell it the plug-in DLL to load and run. You can use this
mechanism to make it all fit together.

Eg:   your-exe --> FAStServer-Dll/Lib --> your-plug-in-DLL.

I hope this is clear and what you wanted.

Rgs, striker

AeroASM

So I need to distribute three things at once? I heard somewhere that you can make a program act as an EXE and a DLL at once.

AeroASM

Just got it - there is only an exe. I take it that you have not yet finished?

James Ladd

I am not finished yet, but the next version I post will be usable.
When done you wont have just an exe to distribute unless you use the exe pretending to be a DLL approach.
Typically you will distribute your EXE, FAStSvr.dll and whatever plug-ins you want to support.


Mark Jones

The project sounds really cool Striker. I've been thinking about building two apps, a "server" and "client" where one person can update "the server" and any number of "clients" can log into that and retrieve data. The 'net has been doing this for decades of course... but not in bare-bones x86 assembler. :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

James Ladd

Mark,
Well your desire for this in bare bones assembler is coming along very very soon.
Im even taking tomorrow off work to tinker with it :)
There will be a client side of the API too so you can talk to FASt server as fast as possible with x86 assembler too !

James Ladd

All,
I have made an update on the web site.
There is a download of code which makes use of a plug-in.
Its not complete, as each time I get somewhere I have more to do :(
Assembler may be good, but boy, it takes a while to get stuff done.
ie: no libraries to use.

Comments on what I have done are welcome.

Rgs, striker.

Mark Jones

Hi Striker, excellent work. :) I tried to open the license.txt file with notepad but the file is UNIX-formatted and the text all runs together. Attached is an ANSI-PC equivalent if this helps.

How do we test the current build? Telnet 127.0.0.1 9080 just gives blank spaces and underscores as echoes, but it does connect. XP Pro SP1.

One very minor request: fastsvr.asm sounds like it could be part of either fastsvr.dll or fastsvr.exe. Could fastsvr.exe be renamed to main.exe to keep the two destinguishable? Just an idea. :U

[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

James Ladd

Mark,
Thanks for having a look.
I wanted to get something out so people knew I was doing something. So right now when you connect all you get is what you
have seen. Sorry if this wasted your time.
Ill check the license file but it should be ok. Maybe its the way I have uploaded it.
It comes out ok on the website when you click the link.

I have a main.asm that gets compiled and named fastsvr.exe as this is the main program you would run.
It in turn uses the fastsvr.dll (compiled from fastsvr.asm) so to me this is logical.
Wont you be running fastsvr.exe in the end ?

Ill post another file today if things do well.

rgs, striker.

James Ladd

ANOTHER FILE FOR DOWNLOAD

This one is the best yet !!!
I would really like it if some people could suggest how the code could be improved
as in how I can use assembler better. I find im running out of registers and re-loading
things and im sure there is a more elegant way.

It will accept connections but not do anything else right now.
Its a total re-write in one day so please dont whip me.

please let me have your comments.

rgs, striker

James Ladd

ALMOST COMPLETE

I have posted another update to the code. Its so close I can almost taste it.
Please have a look and let me know what you think of the code.
Questions welcome.

There is a bug in AcceptEx that I am working through. In the initialise_overlapped routine.
This wont be an issue as I have a working test but I have not worked out the issues with the posted version.
Connect via telnet 9080 but you wont see too much yet - because of AcceptEx

You will see this:


C:\dev\jlc\src>fastsvr
main_create
main_create_server
main_create_events
main_create_network
main_create_io_worker_threads
main_create_io_worker_thread
main_create_io_worker_thread
main_enter_io_worker
main_create_io_worker_thread
main_enter_io_worker
main_create_io_worker_thread
main_enter_io_worker
main_create_listener
main_enter_io_worker
main_create_acceptors
main_create_acceptor
main_initialise_overlapped
main_create_acceptor
main_initialise_overlapped
main_create_acceptor
main_initialise_overlapped
main_create_acceptor
main_initialise_overlapped
main_create_acceptor
main_initialise_overlapped
main_create_scavenger
main_enter_scavenger
main_run
main_run_scavenger
main_run_scavenger
main_run_scavenger
main_cleanup
main_cleanup_listener
main_cleanup_acceptors
main_cleanup_acceptor
main_cleanup_acceptor
main_cleanup_acceptor
main_cleanup_acceptor
main_cleanup_acceptor
main_cleanup_io_worker_threads
main_exit_io_worker
main_exit_io_worker
main_exit_io_worker
main_exit_io_worker
main_cleanup_scavenger
main_cleanup_network
main_cleanup_events
main_cleanup_server


Showing the scavenger and io worker threads going ok.
Plus shutdown is nicely done when you press ctrl-c or close the window.

There is one scavenger thread and there should be 2 io worker threads for each CPU in your system.
This is logical or physical CPU.

rgs, striker.