Small Chat App

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Small Chat App

Luc Fabresse
Hi all,

Raining sunday ;-)

Images intégrées 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"In Pharo 3.0"
Gofer it
smalltalkhubUser: 'LucFabresse' project: 'Grimoire';
package: 'ChatApp';
load.

ChatApplication startLocalExample.
ChatApplication stopLocalExample
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This a 1st draft version of a Chat Application that works. It is implemented in plain Socket with an ad hoc text protocol.

a *lot* should be improved, done or added:

- write tests (it is always a pain to write for client/server apps so here I skip them :-()
- ensure that everything is correctly destroyed/cleaned (processes, sockets, streams, ...). it seems but... needs testing
- refactor to use SocketStream?
- better modularization of commands
- another implementation using Zinc but it would imply using HTTP

Enjoy,

Luc

Reply | Threaded
Open this post in threaded view
|

Re: Small Chat App

Sven Van Caekenberghe-2

> On 01 Feb 2015, at 15:30, Luc Fabresse <[hidden email]> wrote:
>
> Hi all,
>
> Raining sunday ;-)
>
> <ChatApp.png>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "In Pharo 3.0"
> Gofer it
> smalltalkhubUser: 'LucFabresse' project: 'Grimoire';
> package: 'ChatApp';
> load.
>
> ChatApplication startLocalExample.
> ChatApplication stopLocalExample
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> This a 1st draft version of a Chat Application that works. It is implemented in plain Socket with an ad hoc text protocol.
>
> a *lot* should be improved, done or added:
>
> - write tests (it is always a pain to write for client/server apps so here I skip them :-()
> - ensure that everything is correctly destroyed/cleaned (processes, sockets, streams, ...). it seems but... needs testing
> - refactor to use SocketStream?
> - better modularization of commands
> - another implementation using Zinc but it would imply using HTTP

Nice hack, luc.

I would use WebSockets.

Here is a live example

  http://websocket.stfx.eu:9999/ws-chatroom-client

The implementation is part of Zinc-WebSockets. It is just 1 class: ZnWebSocketChatHandler.

> Enjoy,
>
> Luc
>


Reply | Threaded
Open this post in threaded view
|

Re: Small Chat App

Luc Fabresse
Hi Sven,

2015-02-01 16:45 GMT+01:00 Sven Van Caekenberghe <[hidden email]>:

Here is a live example

  http://websocket.stfx.eu:9999/ws-chatroom-client

The implementation is part of Zinc-WebSockets. It is just 1 class: ZnWebSocketChatHandler.

Very nice!
Thanks for the pointer.
I will read your implementation and learn because my Network skills are limited ;-)

Cheers,

Luc
 

> Enjoy,
>
> Luc
>



Reply | Threaded
Open this post in threaded view
|

Re: Small Chat App

stepharo
In reply to this post by Luc Fabresse
Luc

please keep the different versions because it can be quite cool to teach and compare solutions.

Le 1/2/15 15:30, Luc Fabresse a écrit :
Hi all,

Raining sunday ;-)

Images intégrées 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"In Pharo 3.0"
Gofer it
smalltalkhubUser: 'LucFabresse' project: 'Grimoire';
package: 'ChatApp';
load.

ChatApplication startLocalExample.
ChatApplication stopLocalExample
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This a 1st draft version of a Chat Application that works. It is implemented in plain Socket with an ad hoc text protocol.

a *lot* should be improved, done or added:

- write tests (it is always a pain to write for client/server apps so here I skip them :-()
- ensure that everything is correctly destroyed/cleaned (processes, sockets, streams, ...). it seems but... needs testing
- refactor to use SocketStream?
- better modularization of commands
- another implementation using Zinc but it would imply using HTTP

Enjoy,

Luc