[Oberon] AosTCPServices on WinAos
Dan Parnete
parnete at aladata.it
Fri Aug 8 12:23:27 CEST 2003
Hello Felix,
I'm new in area, and I'm discovering the wonderful world of Oberon. I
like it so much, that I intend to switch here all me future projects. I
should like to write some server code running on both Aos and WinAos.
I'm trying to run this on WinAos (it runs fine on Aos) but it fails on
AosTCPServices.OpenService:
MODULE DpsServer;
IMPORT AosModules, AosOut, AosTCP, AosTCPServices, AosIO;
CONST
port = 17;
TYPE
ClientAgent = OBJECT (AosTCPServices.Agent)
VAR w: AosIO.Writer;
BEGIN {ACTIVE}
AosIO.OpenWriter( w, client.Send );
AosIO.WriteString( w, "I'am ready!" );
w.Update;
Terminate
END ClientAgent;
VAR
service: AosTCPServices.Service;
PROCEDURE Open*( par: PTR) : PTR;
BEGIN
RETURN NIL
END Open;
PROCEDURE Close*( par: PTR ) : PTR;
BEGIN
Finalize;
RETURN NIL
END Close;
PROCEDURE Initialize;
BEGIN
AosOut.String( "DpsServer: " );
AosTCPServices.OpenService( service, port, NewClientAgent );
IF (service # NIL) THEN
AosOut.String( "service started." );
ELSE
AosOut.String( "service failed to start." );
END;
AosOut.Ln;
END Initialize;
PROCEDURE Finalize;
BEGIN
AosTCPServices.CloseService( service );
AosOut.String( "DpsServer: service stoped." ); AosOut.Ln
END Finalize;
PROCEDURE NewClientAgent( c: AosTCP.Connection; s:
AosTCPServices.Service ): AosTCPServices.Agent;
VAR a: ClientAgent;
BEGIN
NEW( a, c, s );
RETURN a
END NewClientAgent;
BEGIN
Initialize;
AosModules.InstallTermHandler( Finalize )
END DpsServer.
Aos.Call DpsServer.Open
System.Free DpsServer ~
TRAP access violation in thread Service
AosWinsock.Accept PC = 4929
C = 02D7E5E0H AosWinsock.Connection
newC = NIL reference ( 00000084H )
res = 0
ret = 0
AosTCP.Connection.Accept PC = 1208
@SELF = 02D7E550H AosTCP.Connection
client = 00000000H (AosTCP.Connection)
res = 0
resi = 0
AosTCPServices.Service.$$ PC = 54
@SELF = 02D7E4F0H AosTCPServices.Service
Unknown EIP = 02D7F21AH EBP = 0361FF88H
Is it anything I'm doing wrong ? WinAos needs any special setting for
running AosTCPServices ?
Thanks,
Dan Parnete
parnete at aladata.it
More information about the Oberon
mailing list