AminetAminet
Search:
84479 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/src/SDL_net_demos-AmigaOS.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:SDL_net_demos
Author:Jon Atkins
Uploader:ikepgh yahoo com
Type:dev/src
Requires:SDL, SDL_net
Architecture:m68k-amigaos >= 3.9.0
Date:2007-02-18
Download:http://aminet.net/dev/src/SDL_net_demos-AmigaOS.lha - View contents
Readme:http://aminet.net/dev/src/SDL_net_demos-AmigaOS.readme
Downloads:946

Visit http://www.jonatkins.org

IKE

Original Readme:

ABOUT
~~~~~

    These are some simple programs that demonstrate how to program
    using SDL_net.


COMPILATION
~~~~~~~~~~~

    run "make"

THE PROGRAMS
~~~~~~~~~~~~

dnr.c
    demonstrates:
        Host Name and IP lookup, and initialization of the IPaddress struct
        SDLNet_ResolveHost
        SDLNet_ResolveIP

    try:
        ./dnr 24.8.116.27
        ./dnr jonatkins.org

tcpserver.c
    demonstrates:
        A TCP message server
        SDLNet_ResolveHost (for a server)
        SDLNet_TCP_Open
        SDLNet_TCP_Accept
        SDLNet_TCP_GetPeerAddress
        SDLNet_TCP_Recv
        SDLNet_TCP_Close

    try:
        ./tcpserver 9999

    usage:
        Run as above...
        Then run tcpclient as shown below.
        The tcpclient entered string should show up here when received.
        This server will accept multiple sucessive connections, until it quits.

tcpclient.c
    demonstrates:
        A TCP client for tcpserver
        SDLNet_ResolveHost (for a client)
        SDLNet_TCP_Open
        SDLNet_TCP_Send
        SDLNet_TCP_Close
    
    try:
        ./tcpclient localhost 9999

    usage:  
        Enter a string, or Q to make the tcpserver quit.
        You may call this from another host using the servers hostname
            instead of localhost.
        This should be able to be called multiple times until you make
            the server quit.

tcpmultiserver.c
    demonstrates:
        A TCP chat server that allows multiple clients to connect
            This is actually a feature full server, supporting some /commands
        SDLNet_SocketSet (all functions, except SDLNet_DelSocket's)
    
    try:
        ./tcpmultiserver 9999
    
    usage:
        Run as above...
        Then run tcpmulticlient as shown below.
        The tcpclient entered string should show up here when received.
        The client's strings should also be forwarded to all connected clients.
        Joins and disconnects will be reported to all clients,
            as well as on the server.
        This server will accept multiple connections in parallel,
            until it is killed.

tcpmulticlient.c
    demonstrates:
        A TCP client for the tcpmultiserver
            Also a suitable system for text input while reading a socket.
        SDLNet_SocketSet (just for one socket)
        select (for keyboard input)

    try:
        ./tcpmulticlient localhost 9999 Klonkus
        ./tcpmulticlient localhost 9999 Frumpy

    usage:
        Run the tcpmultiserver as shown above...
        Then run both the above command lines.
        You should see both clients connect to the server.
        Now you can enter messages in each window (press enter)
        The messages will be distributed to the server,
            and then back to the clients.
        Type /help for the commands the server supports...
        Type /quit and an optional message to quit
        Press Control-C (or EOF[Control-D] if you want) to quit harder

tcpmulticlientthreaded.c
    demonstrates:
        same as tcpmulticlient.c
        plus: SDL_Threads are used for all I/O

    try:
    usage:
        (See the tcpmulticlient.c stuff above!)

tcptimesync.c
    demonstrates:
        simple TCP reading and writing
        time syncronization in 5 packets

    try:
        ./tcptimesync 0 7777 &
        ./tcptimesync 500 7777 localhost

    usage:
        tcptimesync lag port [hostname]
            if hostname is not given, the server is started
            lag is the desired simulated lag time in milliseconds
            the lag argument is ignored in server mode
        run the first line above to start the server
        run the second line above to connect and do a time syncronization
        it should settle on a lag close to 500
        but the important thing is that the client time is close to the 
            time the server has...and this is hard to show across the internet.
        (note: more info will be provided on this if you prod me :)

tcptimesyncserver.c
    demonstrates:
        a seemingly more flexible implementation of tcptimesync.c's server half
        it also loops until the server decides that the client is in sync enough
    
    try:
        ./tcptimesyncserver 7777
        (in separate terminal run tcptimesyncclient as shown below)

    usage:
        tcptimesyncserver port [minoff]
            port is the server port number
            minoff is the minimum allowed millisecond error before sync is
                decided to be achieved
        run the client below as many times as you want
        only one client can be synced at any one time
        the server only dies on control-C (or kill)
    
tcptimesyncclient.c
    demonstrates:
        the client side of tcptimesyncserver
    
    try:
        ./tcptimesyncclient localhost 7777 100
    
    usage:
        tcptimesyncclient hostname port [lag]
            hostname and port of a running tcptimesyncserver
            lag is milliseconds of simulated lag desired (1000 = 1 second)
        run the server above then you can run this however many times you like.

udptftpserver.c
    demonstrates:
        an advanced UDP demo
        UDP (and only UDP) file transfer server
        server for udptftpclient
        does not use SDLNet_SocketSet
    
    try:
        ./udptftpserver 7777 6000

    usage:
        udptftpserver port [packet-length]
            port is the server port number
            packet-length is the size of each packet sent for the file transfer
                it must be greater than 6 to work at all...
                I dunno that max size...but 65535 is too big! (it seems)
        this is an insecure server,
            adding security would be an exercise for you.
        this server can only handle one transfer at a time,
            make it do more yourself.
        use with udptftpclient as shown below...

udptftpclient.c
    demonstrates:
        an advanced UDP demo
        UDP (and only UDP) file transfer client
        client for udptftpserver
        does not use SDLNet_SocketSet
    
    try:
        ./udptftpclient localhost 7777 /bin/sh
    
    usage:
        udptftpclient hostname port filename
            hostname and port of a running udptftpserver
            filename is a file available to udptftpserver to read
        this is an insecure client, adding security would be an
            exercise for you.
        filename may have an absolute path to access anything on the
            server's filesystem.
        I achieved a rate of 3.13 MB/s on my 100base local network...
            (1472 bytes/packet udptftpserver)
        I achieved a rate of 4.80 MB/s on local loopback.
            (1797 bytes/packet udptftpserver)
        So I arrived at a safe 1400 bytes/packet in the program.
        A better server may dynamically send more or less packets per group
            to help the network not be overloaded.
        I have transfered files up to almost 192MB in size.
        it could be tweaked along with the server for more performance.


Contents of dev/src/SDL_net_demos-AmigaOS.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                90826  216808  41.9% -lh5- 4459 Feb 21  2005 demos/dnr
[generic]                  724    2236  32.4% -lh5- f830 Feb 21  2005 demos/dnr.c
[generic]                 1725    2007  85.9% -lh5- de6a Feb 21  2005 demos/dnr.c.info
[generic]                  196     346  56.6% -lh5- 4cdb Feb 21  2005 demos/Makefile
[generic]                 2334    7054  33.1% -lh5- 9ab1 Feb 21  2005 demos/README
[generic]                91757  219220  41.9% -lh5- 57f2 Feb 21  2005 demos/tcpclient
[generic]                  665    1739  38.2% -lh5- c9e1 Feb 21  2005 demos/tcpclient.c
[generic]                 1723    2007  85.8% -lh5- 1fdd Feb 21  2005 demos/tcpclient.c.info
[generic]                93939  223560  42.0% -lh5- 4d27 Feb 21  2005 demos/tcpmulticlient
[generic]                 1441    4216  34.2% -lh5- dcad Feb 21  2005 demos/tcpmulticlient.c
[generic]                 1727    2007  86.0% -lh5- ff63 Feb 21  2005 demos/tcpmulticlient.c.info
[generic]                94849  225412  42.1% -lh5- f179 Feb 21  2005 demos/tcpmulticlientthreaded
[generic]                 1642    5429  30.2% -lh5- 4d02 Feb 21  2005 demos/tcpmulticlientthreaded.c
[generic]                 1726    2007  86.0% -lh5- 414c Feb 21  2005 demos/tcpmulticlientthreaded.c.info
[generic]                98584  232144  42.5% -lh5- ed5a Feb 21  2005 demos/tcpmultiserver
[generic]                 3597   13195  27.3% -lh5- e8be Feb 21  2005 demos/tcpmultiserver.c
[generic]                 1724    2007  85.9% -lh5- 19c2 Feb 21  2005 demos/tcpmultiserver.c.info
[generic]                91966  219392  41.9% -lh5- e961 Feb 21  2005 demos/tcpserver
[generic]                  844    2514  33.6% -lh5- 2baa Feb 21  2005 demos/tcpserver.c
[generic]                 1724    2007  85.9% -lh5- c98c Feb 21  2005 demos/tcpserver.c.info
[generic]                93584  226536  41.3% -lh5- 471b Feb 21  2005 demos/tcptimesync
[generic]                 1250    5302  23.6% -lh5- f79b Feb 21  2005 demos/tcptimesync.c
[generic]                 1725    2007  85.9% -lh5- c8a7 Feb 21  2005 demos/tcptimesync.c.info
[generic]                  347     932  37.2% -lh5- eca0 Feb 21  2005 demos/tcptimesync.h
[generic]                93033  221568  42.0% -lh5- 806b Feb 21  2005 demos/tcptimesyncclient
[generic]                  949    2985  31.8% -lh5- 25a8 Feb 21  2005 demos/tcptimesyncclient.c
[generic]                 1725    2007  85.9% -lh5- aaf3 Feb 21  2005 demos/tcptimesyncclient.c.info
[generic]                93918  227020  41.4% -lh5- e86d Feb 21  2005 demos/tcptimesyncserver
[generic]                 1201    4152  28.9% -lh5- d978 Feb 21  2005 demos/tcptimesyncserver.c
[generic]                 1726    2007  86.0% -lh5- b77e Feb 21  2005 demos/tcptimesyncserver.c.info
[generic]                  799    2566  31.1% -lh5- 16cb Feb 21  2005 demos/tcputil.h
[generic]                  951    1389  68.5% -lh5- 76ae Feb 21  2005 demos/tcputil.h.info
[generic]                94586  225136  42.0% -lh5- 7cd3 Feb 21  2005 demos/udptftpclient
[generic]                 1726    5795  29.8% -lh5- ce3b Feb 21  2005 demos/udptftpclient.c
[generic]                 1725    2007  85.9% -lh5- 64fb Feb 21  2005 demos/udptftpclient.c.info
[generic]                95281  226552  42.1% -lh5- 5514 Feb 21  2005 demos/udptftpserver
[generic]                 2112    7645  27.6% -lh5- 89c8 Feb 21  2005 demos/udptftpserver.c
[generic]                 1725    2007  85.9% -lh5- f276 Feb 21  2005 demos/udptftpserver.c.info
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        38 files 1072076 2552920  42.0%            Feb 18 13:55

Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>