Click here to Skip to main content
15,903,385 members
Home / Discussions / C#
   

C#

 
GeneralRe: Setting the System Cursor Pin
Tom Larsen5-Aug-04 12:06
Tom Larsen5-Aug-04 12:06 
GeneralRe: Setting the System Cursor Pin
betterc5-Aug-04 12:47
betterc5-Aug-04 12:47 
GeneralStrange Thread problem Pin
Guinness4Strength5-Aug-04 7:43
Guinness4Strength5-Aug-04 7:43 
GeneralRe: Strange Thread problem Pin
leppie5-Aug-04 13:31
leppie5-Aug-04 13:31 
GeneralRe: Strange Thread problem Pin
Guinness4Strength5-Aug-04 15:14
Guinness4Strength5-Aug-04 15:14 
GeneralRe: Strange Thread problem Pin
leppie5-Aug-04 19:18
leppie5-Aug-04 19:18 
GeneralRe: Strange Thread problem Pin
Guinness4Strength6-Aug-04 3:03
Guinness4Strength6-Aug-04 3:03 
GeneralBizarre remoting problem Pin
Judah Gabriel Himango5-Aug-04 7:25
sponsorJudah Gabriel Himango5-Aug-04 7:25 
I've just spent the last 3 hours trying to debug this one without luck.

my simplified server code:
static void Main()
{
   RemotingServices.Marshal(myObj, "myObj.rem");

   while(true)
   {
      string command = Console.ReadLine();
      if(command == "test") Console.WriteLine("hello");
   }
}


my simplified client code:
IMyObj theServerObj = RemotingServices.Connect(typeof(IMyObj), ...);
theServerObj.DoSomething();


When I run the client and server, the client connects to the server's remote object, then calls the DoSomething method, no problems at all. If I restart the client app while still running the same server instance and run the code again, the client hangs on the .DoSomething() line. Visual Studio's debugger tells me the server is waiting for input on the Console.ReadLine method. And sure enough, if I enter "test" into the console, it writes "hello" and the client is then able to connect. To make matters more mysterious, any attempts to connect by running a client a 3rd, 4th, etc. time works without problem.

So to summarize, the code works without problem the first time a client connects. IF the client is restarted, it doesn't connect until the server gets input. If the client is restarted again (and any consecutive attempts hereafter), all works fine again.

I do use some locks in my code but from what I can tell all locks are released after the first connects; everything should still work. Anyone have any suggestions?

Judah Himango
GeneralRe: Bizarre remoting problem Pin
Heath Stewart5-Aug-04 8:44
protectorHeath Stewart5-Aug-04 8:44 
GeneralRe: Bizarre remoting problem Pin
Judah Gabriel Himango5-Aug-04 10:10
sponsorJudah Gabriel Himango5-Aug-04 10:10 
GeneralRe: Bizarre remoting problem Pin
Heath Stewart5-Aug-04 10:39
protectorHeath Stewart5-Aug-04 10:39 
GeneralRe: Bizarre remoting problem Pin
Judah Gabriel Himango5-Aug-04 10:54
sponsorJudah Gabriel Himango5-Aug-04 10:54 
GeneralRe: Bizarre remoting problem Pin
Tom Larsen5-Aug-04 12:17
Tom Larsen5-Aug-04 12:17 
GeneralRe: Bizarre remoting problem Pin
scadaguy6-Aug-04 6:30
scadaguy6-Aug-04 6:30 
GeneralConverting .rc files to .resx Pin
BrcKcc5-Aug-04 7:20
BrcKcc5-Aug-04 7:20 
QuestionHow to pass array or VARIANT from ATL COM to .NET. Pin
al_1_@hotmail.com5-Aug-04 6:58
al_1_@hotmail.com5-Aug-04 6:58 
AnswerRe: How to pass array or VARIANT from ATL COM to .NET. Pin
Heath Stewart5-Aug-04 8:41
protectorHeath Stewart5-Aug-04 8:41 
GeneralEmpty collections in web services Pin
Diego F.5-Aug-04 6:46
Diego F.5-Aug-04 6:46 
GeneralRe: Empty collections in web services Pin
leppie5-Aug-04 20:09
leppie5-Aug-04 20:09 
GeneralRe: Empty collections in web services Pin
Diego F.6-Aug-04 7:31
Diego F.6-Aug-04 7:31 
GeneralDelivery of parameters to dynamically generated dll Pin
depechemode20015-Aug-04 6:15
depechemode20015-Aug-04 6:15 
GeneralRe: Delivery of parameters to dynamically generated dll Pin
Heath Stewart5-Aug-04 6:21
protectorHeath Stewart5-Aug-04 6:21 
GeneralLogon screen Pin
bthumber5-Aug-04 3:33
bthumber5-Aug-04 3:33 
GeneralRe: Logon screen Pin
Nick Parker5-Aug-04 7:19
protectorNick Parker5-Aug-04 7:19 
GeneralRe: Logon screen Pin
bthumber5-Aug-04 8:12
bthumber5-Aug-04 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.