Re: Communication between a Session and TCP Client Component

Olivier Mengué <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
2009/10/11 Dave Schwartz <[email protected]>

> Hi,
>
> Excuse me for spamming a long mail. Stumbled upon POE and want to use
> it for my latest project.
>
>
Don't worry. All messages on this list are usually quite long.


> Is there something obviously wrong here when the user tries to give an
> offset other than 0 or the way I am trying to send data to the server.
> Any advice would be a great help.
>
>
The problem is that you try to send messages to the server before the
connection occured.

Try to modify your program like this:
- create the $server in the _start event of the main session, and store the
id in $_[HEAP]
- make the Connected event send an event 'Connected' to the main session
- create the watcher on the Connected event in the main session

Olivier.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.