mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
Connect using address passed in. Other cleanup around relay use, name
changes, etc.
This commit is contained in:
parent
da224ee355
commit
7bdfa09406
1 changed files with 8 additions and 8 deletions
|
@ -36,12 +36,12 @@ CSendSocket::RunL()
|
||||||
XP_ASSERT( iStatus.Int() == KErrNone );
|
XP_ASSERT( iStatus.Int() == KErrNone );
|
||||||
if ( statusGood ) {
|
if ( statusGood ) {
|
||||||
iNameRecord = iNameEntry();
|
iNameRecord = iNameEntry();
|
||||||
XP_LOGF( "name resolved: now:" );
|
XP_LOGF( "name resolved" );
|
||||||
ConnectL( TInetAddr::Cast(iNameRecord.iAddr).Address() );
|
ConnectL( TInetAddr::Cast(iNameRecord.iAddr).Address() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EConnecting:
|
case EConnecting:
|
||||||
XP_ASSERT( iStatus.Int() == KErrNone );
|
XP_ASSERT( statusGood );
|
||||||
if ( statusGood ) {
|
if ( statusGood ) {
|
||||||
iSSockState = EConnected;
|
iSSockState = EConnected;
|
||||||
XP_LOGF( "connect successful" );
|
XP_LOGF( "connect successful" );
|
||||||
|
@ -53,7 +53,7 @@ CSendSocket::RunL()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESending:
|
case ESending:
|
||||||
XP_ASSERT( iStatus.Int() == KErrNone );
|
XP_ASSERT( statusGood );
|
||||||
if ( statusGood ) {
|
if ( statusGood ) {
|
||||||
iSSockState = EConnected;
|
iSSockState = EConnected;
|
||||||
iSendBuf.SetLength(0);
|
iSendBuf.SetLength(0);
|
||||||
|
@ -198,7 +198,7 @@ CSendSocket::ConnectL( TUint32 aIpAddr )
|
||||||
User::LeaveIfError( err );
|
User::LeaveIfError( err );
|
||||||
|
|
||||||
// Set up address information
|
// Set up address information
|
||||||
iAddress.SetPort( iCurAddr.u.ip.port );
|
iAddress.SetPort( iCurAddr.u.ip_relay.port );
|
||||||
iAddress.SetAddress( aIpAddr );
|
iAddress.SetAddress( aIpAddr );
|
||||||
|
|
||||||
// Initiate socket connection
|
// Initiate socket connection
|
||||||
|
@ -220,12 +220,12 @@ CSendSocket::ConnectL()
|
||||||
if ( iSSockState == ENotConnected ) {
|
if ( iSSockState == ENotConnected ) {
|
||||||
TInetAddr ipAddr;
|
TInetAddr ipAddr;
|
||||||
|
|
||||||
if ( iCurAddr.u.ip.hostName && iCurAddr.u.ip.hostName[0] ) {
|
if ( iCurAddr.u.ip_relay.hostName && iCurAddr.u.ip_relay.hostName[0] ) {
|
||||||
|
|
||||||
XP_LOGF( "connecting to %s", iCurAddr.u.ip.hostName );
|
XP_LOGF( "connecting to %s", iCurAddr.u.ip_relay.hostName );
|
||||||
|
|
||||||
TBuf16<MAX_HOSTNAME_LEN> tbuf;
|
TBuf16<MAX_HOSTNAME_LEN> tbuf;
|
||||||
tbuf.Copy( TBuf8<MAX_HOSTNAME_LEN>(iCurAddr.u.ip.hostName) );
|
tbuf.Copy( TBuf8<MAX_HOSTNAME_LEN>(iCurAddr.u.ip_relay.hostName) );
|
||||||
TInt err = ipAddr.Input( tbuf );
|
TInt err = ipAddr.Input( tbuf );
|
||||||
XP_LOGF( "ipAddr.Input => %d", err );
|
XP_LOGF( "ipAddr.Input => %d", err );
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ CSendSocket::SendL( const XP_U8* aBuf, XP_U16 aLen, const CommsAddrRec* aAddr )
|
||||||
iSendBuf.Append( aBuf, aLen );
|
iSendBuf.Append( aBuf, aLen );
|
||||||
|
|
||||||
if ( iSSockState == ENotConnected ) {
|
if ( iSSockState == ENotConnected ) {
|
||||||
ConnectL();
|
ConnectL( aAddr );
|
||||||
} else if ( iSSockState == EConnected || iSSockState == EListening ) {
|
} else if ( iSSockState == EConnected || iSSockState == EListening ) {
|
||||||
DoActualSend();
|
DoActualSend();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue