×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    24

    how to connect tcp/ip server to browser

    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
    Join Date
    Jan 2005
    Location
    Helsinki, Finland
    Posts
    257

    Re: how to connect tcp/ip server to browser

    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. Connect to server
    By guibiao in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2004-06-15, 11:43
  2. http error to connect to Activ server
    By supriya_nandi in forum WAP Servers
    Replies: 2
    Last Post: 2002-11-06, 09:32
  3. connecting nokia active server toolkit with the browser
    By khurramyazdanie in forum Nokia M2M
    Replies: 0
    Last Post: 2002-08-07, 04:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×