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.

Reply With Quote


