Skip to content

A Networking API for the D programming language. currently just a concept to use the message passing interface from std.concurrency. overhead currently is 9byte per message.

Notifications You must be signed in to change notification settings

opatut/D-Networking-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

D-Networking-API

A Networking API for the D programming language. Currently just a concept to use the message passing interface from std.concurrency. overhead currently is 9byte per message.

================

Example usage:

int main()
{    
    auto con = Connection.connect(new InternetAddress("127.0.0.1", 9861));
    int i = 0;
    while(true)
    {
        i++;
        {//SEND
            MsgCharacterUpdate msg;
            msg.position = [i,i,i];
            msg.orientation = [i,i,i,i];
            msg.scale = [i,i,i];
            
            writeln("SEND:\n");
            //con.send(12345);
            con.send(msg);
            writeln("--------");
            writeln();
        }
        
        {//RECEIVE
            writeln("RECV:");
            con.receive(
                (MsgCharacterUpdate msg){ writeln(msg); },
                (int i){writeln("INT: ", i);}
            );
            writeln("--------");
            writeln();
        }
        
        Thread.sleep( dur!("msecs")( 1000 ) );
    }
    return 0;
}

About

A Networking API for the D programming language. currently just a concept to use the message passing interface from std.concurrency. overhead currently is 9byte per message.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages