×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Problem with two process communicating via sockets

    Hi all,
    I am working on application where two process should communicate via sockets, with one process ( process A running as back gound process ) creates a socket and listens and other process ( Process B) will connect to that socket and communicate.
    I am facing crash when RSocketServ::Connect() is called in both process's. The code is

    Process A :
    {
    RSocketServ socketServ;
    RSocket listener,blanksocket;
    TSockAddr iAddr(KInetAddrAny);
    iAddr.SetPort(80);

    socketServ.Connect(); // crash with exit type 2,0
    listener.Open(socketServ, KAfInet,KSockStream, KProtocolInetTcp);

    listener.Bind (iAddr);

    listener.Listen (1);

    TRequestStatus aStatus;
    listener.Accept (blanksocket,aStatus);
    User::WaitForRequest(aStatus);
    }



    Process B:
    {
    RSocketServ socketclientServ;
    RSocket clientsocket;
    TRequestStatus Status;

    TSockAddr iAddr(KInetAddrAny);
    iAddr.SetPort(80);


    socketclientServ.Connect(); // crash with exit type 2,0

    // Open a TCP socket
    clientsocket.Open( socketclientServ,KAfInet,KSockStream, KProtocolInetTcp ) ;

    // Initiate socket connection
    clientsocket.Connect( iAddr, Status );
    }


    Am i missing some thing which has to be done before RSocketServ::Connect? Is there any specific port no. for two process on the same system to communicate.

  2. #2
    Registered User
    Join Date
    Feb 2008
    Posts
    48

    Re: Problem with two process communicating via sockets

    Are you testing on emulator ?

    or

    Are you testing on device ? If yes which device ?

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Re: Problem with two process communicating via sockets

    I am working on Device (OMAP board)

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Problem with two process communicating via sockets

    Quote Originally Posted by sai_kumar View Post
    I am working on Device (OMAP board)
    That is nice. However getting the panic code would be even nicer. Normally you could get it as described on http://wiki.forum.nokia.com/index.ph...ded_panic_code
    ExitType is one thing but RProcess has ExitCategory and ExitReason too, try getting them somehow.

    And the problem itself is that you probably can not RSocket::Connect to KInetAddrAny (0.0.0.0), KInetAddrLoop may be a better pick (127.0.0.1) - note that Symbian is not Unix, socket-based IPC is not common, and you may face some side effects too (RSocket::Connect may decide to launch an IAP regardless of the fact that you are connecting to localhost).

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Re: Problem with two process communicating via sockets

    Thank you wizard_hu_ for your repply.

    I was working with tshell image it doesn't worked (panic when RSocketServ::Connect() is called), but with S60 image it works( RSocketServ::Connect() is success and returned KErrNone) but it panicked when listener.Accept (blanksocket,aStatus); is called ( Exit type 2,0 Esock client ).Can you please help me why Accept is panicking ?

    What is the reason for panic when RSocketServ::Connect() is called in tshell image and no panic in s60 image?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Problem with two process communicating via sockets

    Oh, I confused RSocketServ::Connect with RSocket::Connect, sorry about that. If RSocketServ::Connect fails, you probably do not have Socket Server running.
    Unfortunately "Esock client" panic category is not documented in the SDK Help, but there is one called "eSock", which says "client" a lot
    Quote Originally Posted by SDK Help
    Category: eSock panic
    Panic of client from Sockets Server due to server error

    From the TESockCliPanic enumeration.

    0 Failed to create Sockets Server
    I guess it may be correct, and the 2 in your message is TExitType, which is an enumeration of EExitKill,EExitTerminate,EExitPanic,EExitPending

Similar Threads

  1. Problem to process APDU on real external smartcard
    By romain_pellerin in forum Near Field Communication
    Replies: 2
    Last Post: 2009-04-20, 23:08
  2. problem in sending sms using direct sockets
    By somrup.pal in forum Symbian
    Replies: 1
    Last Post: 2007-01-06, 06:42
  3. help: a problem about CICLAnimationDataProvider, my process can't run at N73
    By taiyangfeng008 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-12-26, 12:02
  4. Sockets Problem on Real Phone
    By smallfish_ntu in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-03-20, 14:21
  5. Problem in communicating with 5110
    By Nokia_Archive in forum General Messaging
    Replies: 1
    Last Post: 2002-05-20, 15:51

Posting Permissions

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