Hey Make, here is some example code I whipped up related to "sockets and stuff." The comments should explain what is going on in the code itself.
Simple Client:
Simba Code:
{$f-}
var socket: integer;
begin
// Create & connect our socket
socket = CreateSocket();
ConnectSocket(socket, 'localhost', '4040');
// Say hello, and get a reply
SendSocket(socket, 'Hello!');
writeLn(RecvSocket(socket));
// Say bye and get a reply
SendSocket(socket, 'bye');
writeLn(RecvSocket(socket));
// Clean up
CloseSocket(socket);
FreeSocket(socket);
end.
Simple Server:
Simba Code:
{$f-}
var
serverSocket, clientSocket: integer;
input: string;
begin
// Create & bind our socket so we can accept connections
serverSocket := CreateSocket();
BindSocket(serverSocket, 'localhost', '4040');
// Wait for a socket to connect
ListenSocket(serverSocket);
clientSocket := AcceptSocket(serverSocket);
// Keep listening and responding until client says 'bye'
repeat
input := RecvSocket(clientSocket);
SendSocket(clientSocket, 'Server says: ' + input);
writeLn('from client: ', input);
until input = 'bye';
// Clean up
CloseSocket(clientSocket);
CloseSocket(serverSocket);
FreeSocket(clientSocket);
FreeSocket(serverSocket);
end.
As for the egf files, you can read and interpret them. Do you want examples on how to read from files in Simba? Interpreting the files will be challenging, if my limited understanding of Elmer Front is correct.