Main Page File List File Members Related Pages
frdi_net.c File Reference
handle the internet connections
More...
#include "frdi.h"
Detailed Description
handle the internet connections
- Author:
-
Douglas Reay <douglas-legal@reay.org>
- Warning:
-
- This is OSI Certified Open Source Software. Part of Project Fairdice <http://fairdice.sourceforge.net/>
- Copyright (c) Original Author, 2004. All rights reserved.
- Permission is hereby granted to use, modify and redistribute the contents of this file under the terms of either LGPL 2.1 or MPL 1.1 licenses as published at gnu.org mozilla.org or opensource.org.
- Disclaimer: This code is distributed WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY DISCLAMED. This includes but is not limited to warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
At the top level of abstraction what one wants to do is have connections between applications and send and recieve completed messages. If a message is received the info we need to give is:
- the message
- (if not implicit in the data structure used to pass the message) the size of the message
- (optionally) when the message was received
- which of our connections the message was received from
if a message is to be sent the info we need is:
- which of our connections to use
- the message
- (if not implicit in the data structure used to pass the message) the size of the message
We hereby decree that all messages at this layer will be wrapped in "M <size> <data>" for sending, and be unwrapped before being passed on.
<size> is four hex digits (0..65535). Messages larger than that must be chopped up and sent in pieces by a higher level. (This is to stop a single user of a connection tying it up for minutes at a time. It is also convenient to be able to allocate a buffer of that size.)
we also need to set up the connections, know which handler to use for each connection, which error handler to use for problems, and be able to close a connection.
Objects:
- a connection object
- an application object
- a message object
- a handler object
- an error object
Function Documentation
void frdiOpenListener |
( |
|
) |
|
|
|
Start listening on a particular port |
char* frdiConnectionDescribe |
( |
frdi_connection * |
connection |
) |
|
|
char* frdiConnectionDescribeOld |
( |
frdi_connection * |
connection |
) |
|
|
char* frdiNewRemoteMachineName |
( |
frdi_app * |
self, |
|
|
int |
socket_descriptor |
|
) |
|
|
|
derive the dot form char string from the socket descriptor |
char* frdiDotFormToMachineName |
( |
frdi_app * |
self, |
|
|
char * |
dot_form |
|
) |
|
|
|
convert from a machine name to the dot form |
char* frdiMachineNameToDotForm |
( |
frdi_app * |
self, |
|
|
char * |
machine_name |
|
) |
|
|
|
convert from the dot form to a machine name |
Generated on Wed Aug 18 13:24:01 2004 for Project Fairdice by
1.2.18