... on another front .....
We ran into problems with a simple socket connect to a host PC over the
serial ( RAS into a Win2k box ). We stripped it down to an echo server.
What happens is, well, it just stops receiving on the socket. We know the
app is still running because it still processes events. No errors either. (
no runs, no hits, no errors --- GO MARINERS !!! :)
ANY ideas would be GREATLY appreciated.
-----------------------------------------------------------------------
AppEventLoop( void )
{
EventType Event;
Err Error;
UInt16 NumFds;
NetFDSetType ReadFds;
Int32 TimeOut = -1;
char RxBuf[16];
Int16 rc;
/* Initialize Remote Console */
if( (ConsoleFd = RemoteClient( CONSOLE_PORT,
inet_addr( CONSOLE_IP_ADDR ))) < 0 )
{
printf( "RemoteClient failed - proceeding\n" );
ConsoleFd = -1;
}
/* Main I/O Processing Loop */
while( 1 )
{
netFDZero( &ReadFds );
/* Setup fds if active */
netFDSet( sysFileDescStdIn, &ReadFds );
NumFds = sysFileDescStdIn;
if( ConsoleFd != -1 )
{
netFDSet( ConsoleFd, &ReadFds );
if( ConsoleFd > NumFds )
{
NumFds = ConsoleFd;
}
}
/* Wait for I/O */
if( (rc = NetLibSelect( AppNetRefnum,
NumFds + 1,
&ReadFds,
NULL,
NULL,
TimeOut,
&Error )) < 0 )
{
printf( "select error - %ld\n", Error );
}
/* Input Event Processing */
if( netFDIsSet( sysFileDescStdIn, &ReadFds) )
{
/* Event Processing */
EvtGetEvent( &Event, 1 );
if( !SysHandleEvent( &Event ) )
{
if( !MenuHandleEvent( 0, &Event, &Error ) )
{
if( !AppHandleEvent( &Event ) )
{
FrmDispatchEvent( &Event );
}
}
}
/* Exit on stop event */
if( Event.eType == appStopEvent )
{
if( ConsoleFd != -1 ) close( ConsoleFd );
return;
}
}
/* Remote Console I/O */
if( (ConsoleFd != -1 ) && netFDIsSet( ConsoleFd, &ReadFds ))
{
if( (rc = recv( ConsoleFd, RxBuf, 16, 0 )) < 0 )
{
printf( "recv failed - %ld\n", errno );
}
// echo input
if( send( ConsoleFd, RxBuf, rc, 0 ) < 0 )
{
printf( "send failed - %ld\n", errno );
}
}
}
}
-----------------------------------------------------------------------
thanks
spike
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/