Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
Wireless Developer Network Mailing List
 
Mailing List Archives

Subject: RE: MobileLBSList: TCP/IP Socket problem in Symbian Crystal 6.0
Date:  04/04/2002 03:21:06 AM
From:  Richard Bloor

Arun

It probably is not the cause of your problem but the Nokia 9210 SDK is only
certified to work on Windows NT, I have managed to have it running on
earlier versions of Windows with no obvious problems but I have not tried
Windows 2000. Beyond that I'll have to do some digging as I have not tried
anything similar. Under NT if you want to connect the emulator to a PC
process you need to use RAS and connect two serial ports with a null modem
- you situation may be similar.

If no one else on the MobileLBS can offer any suggestions perhaps the most
useful suggestion I can made is to try the forum at forum.nokia.com or the
Symbian C++ public support forum which you can access from
http://www.symbian.com/developer/public/index.html generally the
subscribers to these will help if they can and certainly have a good
collective technical knowledge

Richard Bloor


-----Original Message-----
From: Arun Patra [SMTP:parun@indts.com\
Sent: Thursday, 4 April 2002 02:01
To: 'mobilelbslist@wirelessdevnet.com'
Subject: MobileLBSList: TCP/IP Socket problem in Symbian Crystal 6.0

Hi All,

I am new to Symbian. Can anybody throw some light for my problem.

I am using the Nokia Crystal C++ SDK based on Symbian Crystal 6.0 .

I have written two simple TCP/IP socket program as below one for client
another for server.
I have compiled both the program successfully and generate two .exe (one
for
client and another for server).
Now I ran these two exe from two different instance of VC++ 6.0 IDE which
in
turn start two Nokia Crystal 9210 emulator
in same machine.

Now I am expecting the following ouput:
Server program opens a listen socket and wait on Accept() call for
incomming connection.
Client program connect to server program.
Server program should do a read request (Recv()) on accepted socket.
Client should send a message.
Server should receive the data and then do a send data back.
Client should receive the data.

But problem is my server program is not waiting on Accept() call. It is
comming out immidiately after a Accept().
So unable to accept client connection.

I have Windows2000 in my PC.

My program codes looks as below:
------------------------------------------------------------------------
----
------------------------
Server program:

LOCAL_C void doTCPServ()
{
_LIT(KSockText,"TCP Socket Testing!
"):
console->Printf(KSockText):

RSocketServ lSession:
RSocket lListenSocket, lSocket:

TInt lErr:

// Connect to the socket server
lErr=lSession.Connect():
User::LeaveIfError(lErr):

TInetAddr lLSockAddr:

lLSockAddr.SetAddress(KInetAddrAny):
lLSockAddr.SetPort(6666):

lErr = lListenSocket.Open(lSession,KAfInet, KSockStream,
KProtocolInetTcp):
User::LeaveIfError(lErr):

lErr = lListenSocket.Bind(lLSockAddr):
User::LeaveIfError(lErr):

lErr = lListenSocket.Listen(1):
User::LeaveIfError(lErr):

lErr = lSocket.Open(lSession):
User::LeaveIfError(lErr):

TRequestStatus status:

lListenSocket.Accept(lSocket,status): //PROBLEM IS HERE::: NOT
WAITING FOR INCOMMING CONNECTION

TBuf8<1024> rbuf:
TSockXfrLength aLen:
lSocket.RecvOneOrMore(rbuf,0,status, aLen):
console->Printf(_L("Received Data is:: "),rbuf):

const TText8* txt = (TText8*)_S("TCP Server Testing!
"):
TBuf8<100> sbuf(txt):
lSocket.Send(sbuf, 0, status):
}

Client program:

LOCAL_C void doTCPClient()
{
TRequestStatus status:
RSocketServ lSession:
RSocket lListenSocket, lSocket:

TInt lErr:

// Connect to the socket server
lErr=lSession.Connect():
User::LeaveIfError(lErr):

lErr = lListenSocket.Open(lSession,KAfInet, KSockStream,
KProtocolInetTcp):
User::LeaveIfError(lErr):

TInetAddr lServSockAddr:
const TS_UINT32 addr = INET_ADDR(12,12,110,118):
lServSockAddr.SetAddress(addr):
lServSockAddr.SetPort(6666):

lSocket.Connect(lServSockAddr,status):

const TText8* txt = (TText8*)_S("TCP Client Testing!
"):
TBuf8<100> sbuf(txt):
lSocket.Send(sbuf, 0, status):

TBuf8<100> rbuf:
TSockXfrLength aLen:
lSocket.RecvOneOrMore(rbuf,0,status, aLen):

console->Printf(_L("Received Data is:: "),rbuf):
}
------------------------------------------------------------------------
----
---------------------------------

Your effort and time is highly appriciated.

Regards,
-Arun




To unsubscribe, write to mobilelbslist-unsubscribe@geocomm.com
______________________________________________________________
Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com