Hello!
This is a simple sockets library I called my-sock (lack of inspiration I know!)
It's for Windows only (sorry, I don't have ANY experience in Linux programming) but I think the adaptation is possible (and simple)
It's designed around 2 objects:
- mySrv_t: Multi-clients TCP server, callbacks based
- myCln_t: Simple TCP client
Data is sent with standard send/recv functions. So you can use the server as a HTTP server for example.
The code is documented (see main.bas, myserver.bas and myclient.bas), and there are examples and .bat build scripts.
Here it is
MySock - Simple Sockets Library
-
- Posts: 70
- Joined: Jun 11, 2011 3:36
Re: MySock - Simple Sockets Library
Hello! Thank you very much for your work!
But could you include compiled libraries in your package, please? I'm a noob in making libraries myself and I think I'm not alone, so pre-made libraries will be very useful not only for me. :D
Thank you!
But could you include compiled libraries in your package, please? I'm a noob in making libraries myself and I think I'm not alone, so pre-made libraries will be very useful not only for me. :D
Thank you!
-
- Posts: 70
- Joined: Jun 11, 2011 3:36
Re: MySock - Simple Sockets Library
If your on Windows, all you have to do is lanche one of the 2 .bat files, and you'll have compiled libraries (Dynamic/Static) in the bin\ folder (that will be created by the .bat)
If you're on Linux, I'm sorry but the lib is (for the moment) Windows only.
I think the adaptation is very simple (removing some Windows-only funcs) but I'm NEVER programmed for Linux, and I don't want to make crap code.
If you're on Linux, I'm sorry but the lib is (for the moment) Windows only.
I think the adaptation is very simple (removing some Windows-only funcs) but I'm NEVER programmed for Linux, and I don't want to make crap code.
-
- Posts: 70
- Joined: Jun 11, 2011 3:36
Re: MySock - Simple Sockets Library
Examples added (HTTP get, and web server)
Please report any bugs, or suggestions
Please report any bugs, or suggestions
Re: MySock - Simple Sockets Library
Sorry, but where should I place all this contents of your zip package to get .bat's working, e.g. to compile the libraries?
-
- Posts: 70
- Joined: Jun 11, 2011 3:36
Re: MySock - Simple Sockets Library
All you have to do is unzip the package (my-sock-master.zip) and then execute build_dll.bat and build_lib.bat
After that, if you want the examples, just run examples\build_examples.bat and follow the instructions.
Note that in order to build the examples, you need to have built the static version of the lib (build_lib.bat)
After that, if you want the examples, just run examples\build_examples.bat and follow the instructions.
Note that in order to build the examples, you need to have built the static version of the lib (build_lib.bat)
Re: MySock - Simple Sockets Library
fotoncat,
Since I don't have fbc in my path statement, I did this WINXP, SP3:
[1] Unzip the "my-sock-master" folder to "G:\fb.24\my-sock-master\" (my path, your path is probably different).
[2] Edit the two batch files "build_dll.bat" and "build_lib.bat" so that every occurrence of 'fbc' becomes '..\fbc' (without the single-quotes).
[3] In the "examples" folder, edit the batch file "build_examples.bat" so that every occurrence of 'fbc' becomes '..\..\fbc' (again, without single quotes).
When you run these batch files now, they will know where to find fbc by the relative paths you've just supplied.
The batch files will create \bin\dll and \bin\lib where you should find the library files you need.
Worked for me.
hth,
Jim
Since I don't have fbc in my path statement, I did this WINXP, SP3:
[1] Unzip the "my-sock-master" folder to "G:\fb.24\my-sock-master\" (my path, your path is probably different).
[2] Edit the two batch files "build_dll.bat" and "build_lib.bat" so that every occurrence of 'fbc' becomes '..\fbc' (without the single-quotes).
[3] In the "examples" folder, edit the batch file "build_examples.bat" so that every occurrence of 'fbc' becomes '..\..\fbc' (again, without single quotes).
When you run these batch files now, they will know where to find fbc by the relative paths you've just supplied.
The batch files will create \bin\dll and \bin\lib where you should find the library files you need.
Worked for me.
hth,
Jim
Re: MySock - Simple Sockets Library
Thank you, nobozoz!