I am trying to get up and running using Synapse to send and receive over
sockets. Previously I have used Borland's TClientWinSocket in a
non-blocking mode with good results.
I have looked at the Synapse echo sample and see two threads are used,
one to monitor the port and then a second thread to for each connection
made to that port. Is this the recommended method as ideally I'd just
like to use the OnStatus event to tell me when there is new data to read
but the OnStatus event does not get called in my very simple single
threaded test program below:
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
m_pBlockSocket=new TTCPBlockSocket();
m_pBlockSocket->CreateSocket();
m_pBlockSocket->SetLinger(true,10);
m_pBlockSocket->Bind("192.168.1.11","67");
m_pBlockSocket->GetSins();
m_pBlockSocket->Listen();
m_pBlockSocket->OnStatus=SocketStatus;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SocketStatus(TObject *pSender,THookSocketReason
reason,const String value)
{
ListBox1->Items->Add("Event: "+value);
}
So my question is: am I trying to use Synapse in a way it is not
designed to be used and I must go to a multithreaded solution?
Your help is appreciated or please point me to a working example of
sending data and receiving a 'new data has arrived' event over sockets
using Synapse
thanks
paul
--
Regards
Paul Read
nSolve Ltd
Premier House
85 High Street
Witney
OX28 6HY
England
Tel: +44 (0) 1993 771117
www.nsolve.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public