Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User k.sandeep's Avatar
    Join Date
    Mar 2006
    Posts
    24
    hi,
    I running my tcp/ip server in series 60 mobile which have to connect to browser (in browser i did proxy settings 127.0.0.1 port 9393) but my server application it gets hanged & i am unable to open browser. I found that my server is waiting near Accept( ) and not allowing other applications to run ,
    So can any one say me how to connect my server to browser

    This is my server code

    lErr=iServerSession.Connect();
    User::LeaveIfError(lErr);
    iLSockAddr.SetAddress(KInetAddrAny);
    iLSockAddr.SetPort(9393);

    lErr = iListenSocket.Open(iServerSession,
    KAfInet,
    KSockStream,
    KProtocolInetTcp);

    User::LeaveIfError(lErr);

    lErr = iSocket.Open(iServerSession);
    User::LeaveIfError(lErr);


    lErr = iListenSocket.Bind(iLSockAddr);
    User::LeaveIfError(lErr);

    lErr = iListenSocket.Listen(1);
    User::LeaveIfError(lErr);

    // lErr = iSocket.Open(iServerSession);
    // User::LeaveIfError(lErr);

    // sleep(60);


    iListenSocket.Accept(iSocket,iStatus);
    User::WaitForRequest(iStatus);
    Thanking you
    sandeep

  2. #2
    Registered User madsum's Avatar
    Join Date
    Jan 2005
    Location
    Helsinki, Finland
    Posts
    257
    HI,

    This is completely OK to be hanged on
    iListenSocket.Accept(iSocket,iStatus);
    User::WaitForRequest(iStatus);
    It will wait until it receives any incoming connection or until timeout. It seems it is an active object (as I can see the member iStatus). Try as follows:

    iListenSocket.Accept(iSocket,iStatus);
    SetActive();

    and when it accepts any incoming connection RunL() will be called and you can handle it there. For more information, check Socket example.
    Do it now! Today will be yesterday tomorrow - MadSum

Similar Threads

  1. How Browser connects to Server
    By S.S.Sudhakar in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2005-08-27, 06:55
  2. Connect to server
    By guibiao in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2004-06-15, 11:43
  3. http error to connect to Activ server
    By supriya_nandi in forum WAP Servers
    Replies: 2
    Last Post: 2002-11-06, 09:32
  4. connecting nokia active server toolkit with the browser
    By khurramyazdanie in forum Nokia M2M
    Replies: 0
    Last Post: 2002-08-07, 04:05
  5. Unable to connect to Nokia Activ Server 2.1 using Mobile Internet Toolkit 3
    By Nokia_Archived in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2002-05-17, 12:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved