Click here to Skip to main content
15,666,844 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why The remote server returned an error: (403) Forbidden? Pin
bug_aonz13-Sep-07 16:30
bug_aonz13-Sep-07 16:30 
QuestionSearch for a file Pin
P_Elza12-Sep-07 23:51
P_Elza12-Sep-07 23:51 
AnswerRe: Search for a file Pin
Pete O'Hanlon12-Sep-07 23:59
subeditorPete O'Hanlon12-Sep-07 23:59 
QuestionInserting a formula in excel Pin
lourensG12-Sep-07 23:51
lourensG12-Sep-07 23:51 
AnswerRe: Inserting a formula in excel Pin
Jimmanuel13-Sep-07 3:02
Jimmanuel13-Sep-07 3:02 
GeneralRe: Inserting a formula in excel Pin
lourensG13-Sep-07 3:10
lourensG13-Sep-07 3:10 
QuestionStrange Issue:Window Service Pin
ramdil12-Sep-07 23:48
ramdil12-Sep-07 23:48 
QuestionRemoting events sometimes failing Pin
Lasse Offt12-Sep-07 23:43
Lasse Offt12-Sep-07 23:43 
Hi guys.

I have, after alot of hard work, finally got this to work - well.... almost Smile | :)

I have a remoting server using TCPChannel. And i got some clients connecting to this server. When i from the beginning connects 3 client, all works fine, when someone connects, the server sends events to each client that they should update their list of clients. But when one of them Disconnects with this code:

if (SignedIn)<br />
{<br />
     server.SignOut(MyUniqueID); //Removes him from the array of clients<br />
     ChannelServices.UnregisterChannel(Channel);<br />
}


And then siqns in again, he's not getting the event when someone connects or disconnects, but the other clients does, even when the failing client connects/disconnects. BUT if i close this one client that fails, and open it up again, it all work just fine again, very strange.


I got a very simple and clean example code if anyone wants to help me Smile | :)


//Server Void Main code//<br />
BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();<br />
serverProv.TypeFilterLevel = TypeFilterLevel.Full;<br />
<br />
IDictionary props = new Hashtable();<br />
props["name"] = "ServerChannel";<br />
props["port"] = 666;<br />
<br />
<br />
TcpChannel Channel = new TcpChannel(props, null, serverProv);<br />
ChannelServices.RegisterChannel(Channel, false);<br />
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Server), "Server", WellKnownObjectMode.Singleton);<br />
            <br />
Console.WriteLine("Server is running...");





//Client code//<br />
inaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();<br />
serverProv.TypeFilterLevel = TypeFilterLevel.Full;<br />
IDictionary props = new Hashtable();<br />
props["port"] = 0;<br />
<br />
//Hook us on the event to communicating with server<br />
CallbackSink.OnHostToClient += new ClientEvent(OnHostToClient);<br />
<br />
//Make the connection<br />
Channel = new TcpChannel(props, null, serverProv);<br />
ChannelServices.RegisterChannel(Channel, false);<br />
server = (Server)Activator.GetObject(typeof(Server), "tcp://127.0.0.1:666/Server");

AnswerRe: Remoting events sometimes failing Pin
Lasse Offt13-Sep-07 21:19
Lasse Offt13-Sep-07 21:19 
AnswerRe: Remoting events sometimes failing Pin
John Whitmire2-Nov-07 6:17
professionalJohn Whitmire2-Nov-07 6:17 
QuestionString table equivalent in C# Pin
Keshav V. Kamat12-Sep-07 23:42
Keshav V. Kamat12-Sep-07 23:42 
AnswerRe: String table equivalent in C# Pin
Paul Conrad14-Sep-07 19:06
professionalPaul Conrad14-Sep-07 19:06 
QuestionUsing C , C++, VC++ code libraries in C#.net Pin
venkatinaidu12-Sep-07 23:39
venkatinaidu12-Sep-07 23:39 
AnswerRe: Using C , C++, VC++ code libraries in C#.net Pin
Giorgi Dalakishvili12-Sep-07 23:47
mentorGiorgi Dalakishvili12-Sep-07 23:47 
Question.NET dll in asp/vb code Pin
mpavas12-Sep-07 23:32
mpavas12-Sep-07 23:32 
AnswerRe: .NET dll in asp/vb code Pin
Sandeep Akhare12-Sep-07 23:33
Sandeep Akhare12-Sep-07 23:33 
GeneralRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:36
mpavas12-Sep-07 23:36 
GeneralRe: .NET dll in asp/vb code Pin
Sandeep Akhare12-Sep-07 23:42
Sandeep Akhare12-Sep-07 23:42 
GeneralRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:45
mpavas12-Sep-07 23:45 
AnswerRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:33
mpavas12-Sep-07 23:33 
QuestionTHE FAST FUNCTION TO READ / WRITE FILE? Pin
AlexB4712-Sep-07 23:26
AlexB4712-Sep-07 23:26 
AnswerRe: THE FAST FUNCTION TO READ / WRITE FILE? Pin
lmoelleb13-Sep-07 0:15
lmoelleb13-Sep-07 0:15 
Questiontransparent maskededit box? Pin
TheCardinal12-Sep-07 23:25
TheCardinal12-Sep-07 23:25 
QuestionNetron Pin
Mamphekgo Bahula12-Sep-07 22:59
Mamphekgo Bahula12-Sep-07 22:59 
AnswerRe: Netron Pin
Colin Angus Mackay12-Sep-07 23:22
Colin Angus Mackay12-Sep-07 23:22 

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.