[Mono-dev] WCP and ServiceHost

2010-02-23 Thread Ásgeir Halldórsson
Hello,

I have a strange problem with WCF and ServiceHost is seams my 
server is not listening sometimes (like 50/50).  Has anyone had the same 
problem,  Also my client hangs on trying to connect and does not throw and 
error after 5 sec like the config tells it to.  Any comments?

CODE Server:
Uri uri = new Uri(ConfigurationManager.AppSettings["addr"]);
host = new ServiceHost(typeof(GlobalService), uri);
host.Open(); //Returns always

Config Server:
  


  
  


  



  



  

  

  



  


  
  


  


  


Clinet CODE:
var client = new Proxy.GlobalServiceClient();
client.Open(); // Hangs like 50/50 of the time

Client config
  

  


  

  
  

  

  
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Bug in trunk version of xsp / mono

2010-02-12 Thread Ásgeir Halldórsson
Hi all,

I have been having issues for the past 2 days with installing 
latest version of mono with apache.  Always getting Argument size exception.  
After alot of debugging I fould the issue and here is a fix if anyone wants.



In ModMonoRequest.cs
void FillBuffer (int count)
{
if (reader_ms.Capacity < count)
reader_ms.SetLength (count);

// This will "reset" the stream
reader_ms.SetLength (0);
reader_ms.Seek (0, SeekOrigin.Begin);

byte[] buffer = reader_ms.GetBuffer ();
int received = client.Receive (buffer, count, 
SocketFlags.None);
reader_ms.SetLength (received);
}

Should be,  I am not sure if this is a bug in mono or the xsp but atleast xsp 
is assuming how MemoryStream handles buffer.

void FillBuffer (int count)
{
if (reader_ms.Capacity < count)
reader_ms.SetLength (count);

// This will "reset" the stream
reader_ms.SetLength (0);

//byte[] buffer = reader_ms.GetBuffer ();
byte[] buffer = new byte[count];
int received = client.Receive (buffer, count, 
SocketFlags.None);
//reader_ms.SetLength (received);
reader_ms.Write(buffer, 0, received);
reader_ms.Seek (0, SeekOrigin.Begin);
}

Regards,
Ásgeir Halldórsson
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list