String sendSSAPMsg(String msg)
	{  String ret="";
	int err=0;

	deb_print("KpCore:message to send:_"+msg.replace("\n", "")+"_");
	deb_print("KpCore:SSAP:Open connection...");

	if((err = openConnect())  <0) {err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] );  KP_ERROR_ID=err; return null;}
	else {deb_print("KpCore:SSAP:"+ERR_MSG[(err)] );}

	deb_print("KpCore:SSAP:Send the message...");
	if((err =send( msg     ))  <0) {err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] );  KP_ERROR_ID=err; return null;}
	else {deb_print("KpCore:SSAP:"+ERR_MSG[(err)] );}

	deb_print("KpCore:SSAP:Read the answer...");

	if(msg.indexOf("<transaction_type>UNSUBSCRIBE</transaction_type>")<0)
		try{ ret = receive();
		deb_print("KpCore:SSAP:answer:"+"ok _"+ret.replace("\n", "")+"_\n");}
	catch(Exception e){err=this.KP_ERROR_ID;
	if(err<0) err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] );
	else{ err=ERR_RECEIVE_FAIL;
	if(err<0) err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] );
	}
	err_print("EXCEPTION: "+e.toString()); e.printStackTrace(); KP_ERROR_ID=err; return null;}

	//if(msg.indexOf("")>=0)
	else deb_print("KpCore:SSAP:UnSubscription Request:no answer expected:"+"ok"+"\n"); 

	deb_print("KpCore:SSAP:Close connection...");
	if((err= closeConnection()) <0) {err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] );  KP_ERROR_ID=err; return null;}

	if(this.KP_ERROR_ID>=0)this.KP_ERROR_ID=err;
	return ret;
	}//String SSAP(String msg)