I download RabbitMQ.com 's .Net DLL C# Source code to compile success in
MonoDevelop, then use it to receive RabbitMQ message, all code is correct (
in my PC .Net application is fine to get RabbitMQ Message in the same
code),but in MonoTouch (iOS) Project it appears exception:


[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.EndOfStreamException:
SharedQueue closed
  at RabbitMQ.Util.SharedQueue.EnsureIsOpen () [0x00000] in <filename
unknown>:0 
  at RabbitMQ.Util.SharedQueue.Dequeue (Int32 millisecondsTimeout,
System.Object& result) [0x00000] in <filename unknown>:0 
  at testRabbitMQ.FirstViewController.ThreadStart (System.Object args)
[0x0007b] in
/Users/dev2/Projects/testRabbitMQ/testRabbitMQ/FirstViewController.cs:109 
  at System.Threading.Thread.StartInternal () [0x00032] in
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:699
 
Terminating runtime due to unhandled exception
Stacktrace:



IModel channel=null;
string ServerIP="192.168.68.4";
string queueName="172.16.1.1";
//int port672;
ConnectionFactory cf=new ConnectionFactory();




cf.HostName=ServerIP;




//
cf.Protocol=RabbitMQ.Client.Protocols.DefaultProtocol;


IConnection connÏ.CreateConnection();


Console.WriteLine ("factory.CreateConnection()");


channel = conn.CreateModel ();


Console.WriteLine ("RECEIVE :
_RMQConnection.CreateModel()");


channel.QueueDeclare(queueName, true,
false,false,null);






_receiveMessageConsumer = new
QueueingBasicConsumer(channel);


channel.BasicConsume(queueName, true,
_receiveMessageConsumer);




Console.WriteLine("channel.BasicConsume(_QueueName, true,
_receiveMessageConsumer)....");


while (_DoneFlag=úlse) {
object result = null;


_receiveMessageConsumer.Queue.Dequeue(400, out result);


BasicDeliverEventArgs messageInEnvelope null;
if (result!=null)
{
messageInEnvelope (BasicDeliverEventArgs)result;
}


if (messageInEnvelope == null) {




Console.WriteLine("messageInEnvelope == null)");
continue;
}


byte[] bytes messageInEnvelope.Body;
string
str=System.Text.Encoding.UTF8.GetString(bytes);
Console.WriteLine("???????" + str);


//RMQMessage msg
JsonConvert.DeserializeObject<RMQMessage>(System.Text.Encoding.UTF8.GetString(bytes));


//System.Threading.Thread.Sleep(30);
}


My all IP and other parameters are correct.

is there people have MonoTouch available DLL , i think maybe MonoTouch Queue
Class 's problem?




--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Appear-SharedQueue-closed-Error-when-i-use-RabbitMQ-DLL-to-get-RabbitMQ-Message-tp4658040.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to