Alaska Software Inc. - ASINet with events?
Username: Password:
AuthorTopic: ASINet with events?
Carsten PosingiesASINet with events?
on Wed, 18 Sep 2002 11:11:02 +0200
Hello,

I'm currently experimenting with the ASINet lib.

Has anyone done a framework that gives the socket some "event" behaviour?

Mainly, it could hide the whole event loop from the developer.

Some example code how it might look like:



procedure main
    local oInet := ASInetwithEvents():new()

    oInet:ForkOnConnect := .t.
    oInet:OnConnect := {|a|myconnectfnct(a)}
    oInet:OnDataArrival : {|a|myfncttoreaddatafromsocket(a)}

    oInet:Start()
return

function myconnectfnct(nSocket)
    ...
return lSuccess

function myfncttoreaddatafromsocket(nSocket)
    ...
return cInputfromSocket



I like the event driven paradigm a lot. But maybe I'm the only one 

Carsten
boris@nospam.SQLExpress.net Re: ASINet with events?
on Wed, 18 Sep 2002 16:26:25 +0200
c.posingies@gmx.de (Carsten Posingies) wrote in <3d884202@asgcom.alaska-
software.com>:

>I'm currently experimenting with the ASINet lib.
>Has anyone done a framework that gives the socket some "event" behaviour?
>Mainly, it could hide the whole event loop from the developer.
>Some example code how it might look like:
>
>procedure main
>    local oInet := ASInetwithEvents():new()
>    oInet:ForkOnConnect := .t.
>    oInet:OnConnect := {|a|myconnectfnct(a)}
>    oInet:OnDataArrival : {|a|myfncttoreaddatafromsocket(a)}
>    oInet:Start()
>return

Xb2.NET provides events like: OnConnect, OnMaxConnect, OnGET, OnError, 
Encode, Decode, and many more. See: http://www.xb2.net


Best regards,
Boris Borzic

http://www.SQLExpress.net
industrial strength C/S development tool
Thomas Braun Re: ASINet with events?
on Wed, 18 Sep 2002 17:27:54 +0200
Carsten Posingies wrote:

> Hello,
> I'm currently experimenting with the ASINet lib.
>
> Has anyone done a framework that gives the socket some "event" behaviour?
>
> Mainly, it could hide the whole event loop from the developer.
>
> Some example code how it might look like:

This should be quite easy with the Thread() class, but I have had no time
to take a deeper look into ASINET...

Does anyone know a good tutorial for socket programming?


regards,
Thomas Braun

web: www.software-braun.de / email: nospam@wegasoft.de
If you need to send email, substitute "nospam" with my initials
since the spam account is not checked on a regular basis.
Xbase++ FAQ : faq.xbasecentral.net
Uwe Gellhaus Re: ASINet with events?
on Thu, 19 Sep 2002 13:04:32 +0200
Thomas Braun Re: ASINet with events?
on Thu, 19 Sep 2002 15:57:25 +0200
Uwe Gellhaus wrote:

>>
>> Does anyone know a good tutorial for socket programming?
>>
>
> Here are some internet resources about socket programming:

Muchos gracias! (my Spanish is fantastic, isn't it? 

regards,
Thomas Braun

web: www.software-braun.de / email: nospam@wegasoft.de
If you need to send email, substitute "nospam" with my initials
since the spam account is not checked on a regular basis.
Xbase++ FAQ : faq.xbasecentral.net
Jose Luis OterminRe: ASINet with events?
on Thu, 19 Sep 2002 11:48:27 -0300
> Muchos gracias! (my Spanish is fantastic, isn't it? 

Deine spanisch ist vorzuziehen ber mein deutsch )

Saludos


--
 Jos Luis Otermin

oterminATciudad.com.ar
ICQ 8797524
Thomas Braun Re: ASINet with events?
on Thu, 19 Sep 2002 17:57:52 +0200
Jose Luis Otermin wrote:
> Deine spanisch ist vorzuziehen über mein deutsch )

Well, I could not say the above sentence in spanish, so you clearly are in
advantage.

My spanish knowledge is limited to "solid-and-fluid ordering spanish" like
"un cerveza per favor" 

regards,
Thomas Braun

web: www.software-braun.de / email: nospam@wegasoft.de
If you need to send email, substitute "nospam" with my initials
since the spam account is not checked on a regular basis.
Xbase++ FAQ : faq.xbasecentral.net
phil@idep.org.uk Re: ASINet with events?
on Thu, 19 Sep 2002 11:36:31 +0000
>> I'm currently experimenting with the ASINet lib.
>>
>> Has anyone done a framework that gives the socket some "event" behaviour?
>>
>> Mainly, it could hide the whole event loop from the developer.
>>
>> Some example code how it might look like:
>
>This should be quite easy with the Thread() class, but I have had no time
>to take a deeper look into ASINET...

Take a look at ...SOURCE\samples\ASINET\SOCKETS\server.prg

This create a thread to monitor a port for new connections, and spawns
new threads to administer each new connection.

Yiu should be able to tailor the ClientThread() class to suit your
requirements.

Regards,

Phil Ide

Xbase++ FAQ
current release: 8,  Monday 4th February 2002, 14:54
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***

BRAIN, n. An apparatus with which we think what we think.  That which 
distinguishes the man who is content to _be_ something from the man 
who wishes to _do_ something.  A man of great wealth, or one who has 
been pitchforked into high station, has commonly such a headful of 
brain that his neighbors cannot keep their hats on.  In our 
civilization, and under our republican form of government, brain is so 
highly honored that it is rewarded by exemption from the cares of 
office.

 - the Devil's Dictionary, Ambrose Bierce