|
can custom datasets be used in rdl while generating it programmatically ?
Prithiv Thirugnanasambsandam Vasudevan
|
|
|
|
|
|
My user profile is not Admin.
I wrote a code that sends ping,
it works when I logon with admin password,
but doesn't work when I logon with my user (that is not admin).
Thanks..
|
|
|
|
|
|
Thank you for your reply!
Ok. I got it. I need admin account.
Actually My problem is ;
I wrote a small server (listens tcp port),
when a client's cable unplugged, I want my server detect this,
and says this client is disconnected,
Do you know how can I do it?
thank you very much...
|
|
|
|
|
The server cannot detect this at all. As I put in your other post, PING'ing the client is not a reliable method considering the client might be behind a firewall or NAT that won't let ICMP traffic through it.
The only thing you can do is build in a "keep alive" where the client must send these "keep alive" requests to the server every so often. If the server stops receiving these requests from the client within a specified time period, it can assume that the client is no longer connected.
I don't know how much traffic or how many clients you're expecting, but this has scalability limitations. If you get enough clients connected, you could conceivably have 80%, or more, of the traffic going to the server just "keep alive"'s, resulting in very slow performance.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That's Right. but my problem is that my clients may anyone. I mean. any client who knows my server IP and Port Number can connect to my server.
that is clients cannot send me message that they are online or something.. because they don't know the way I search them...
They can only send me string messages and my server display it on the received screen.. (of sure incoming messages are token as bytes no problem at this fact at all)..
As a result, server has to detect which clients are online or not! by a way ping or something..
By this way , I know that all the work done by server and server has much work to do.. But I have to...
Thank you very much for reply..
Greetings....
Alper.
Software Developer.
|
|
|
|
|
Your client may be anyone, anywhere on the planet?
Since you're trying to determine if the client disconnects unexpectedly, I'm assuming that you have to keep state information for the duration of the client session. Is this correct?
Are you writing a client piece to this also? If so, then you could include code that would send a "keep alive" request back to the server so the server knows it's still connected. After a certain timeout, if no "keep alive" request has been received by the server, you can assume the client either lost communication or terminated the client for some reason.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Unfortunately I'm writing only the Server Part,
and the clients are electronic cards that
has the client code in their EP-ROM and flash memory.
If their battery gets low or power-off my or their network cable unplugged, my server has to detect it.
Because the memory is very important for the EP-ROM based electronic cards client. Any Keep-Alive Send code couldnt be added into the clients.
Again Thank you very much...
|
|
|
|
|
You could have put that little tidbit into your original post!
Now, your options are extremely limited...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, im new to C# and have a problem when i must assign methods to objects i create in execution mode.
while in design mode u can create a timer and then double click on it and there u go, but how can i attach a method to a timer i have created in execution time?
<br />
using System.Timers;<br />
<br />
Timer t = new timer(30000);<br />
t.enabled=true;<br />
Ty for ur time.
|
|
|
|
|
Timer t = new Timer(new TimerCallBack(Your Method));
and then handle all the rest
|
|
|
|
|
Declare your Timer
[code]
System.Timers.Timer myTimer = new System.Timers.Timer(1000);
// 1000 is the Interval used by the Timer in ms, i.e. the time between two "Timer.Elapsed" Events
[/code]
Then add an EventHandler
[code]
myTimer.Elapsed +=new System.Timers.ElapsedEventHandler(myTimer_Elapsed);
// Note: In VS.NET 2003, as soon as you type the +=, VS will ask you to press
// TAB. If you do, it will code-complete everything else, even the Delegate's
// body if you press TAB again.
[/code]
Now, on each Elapsed-Event, the Delegate will be executed
[code]
//If you are not using VS.NET, this is what the delegate should look like:
private void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
}
[/code]
|
|
|
|
|
TY a lot for your help and examples, it works perfect now.
|
|
|
|
|
I have a tcp server, when a client connects, then let its cable unplugged!
Then How can server detect that it is disconnected?
Thanks all!
|
|
|
|
|
It can't. The only thing it can do is assume that the client dropped the connection without closing it, because of a complete lack of communication for a specified timeout period.
Or, with a little more thought, the server can try and PING the client every so often to see if it is still alive. This has it's problems too considering the client might be behind a firewall that won't let ICMP packets through.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It isn't really true that the server can't detect that the client disconnected. But the server can't detect it just by sitting there. I had some code somewhere that managed this by having the server periodically switch the socket to nonblocking mode and try to do a read in peek mode. Note that the receive in peek mode might return WSAEWOULDBLOCK if the socket is still live and there is nothing to read on it. But if the socket is closed, it will not return an exception. That is why I preload the bytes[] array with some data that I can then compare the read result against, of course assuming that I would never expect the read to contain that exact byte pattern. There might be a better way, but this worked fine for me.
try
{
// Try doing a dummy read to see if the socket is still alive
bytes[0] = 0xf;
bytes[1] = 0xe;
bytes[2] = 0xd;
bytes[3] = 0xc;
socket.Blocking = false;
socket.Receive(bytes, 0, 4, SocketFlags.Peek);
socket.Blocking = true;
if (bytes[0] == 0xf && bytes[1] == 0xe && bytes[2] == 0xd && bytes[3] == 0xc)
{
// The sender has shut down the socket
bexitreadloop = true;
socket.Close();
form1.DisplaySocketStatusMessage("Lost connection with sender");
break;
}
}
catch (SocketException e)
{
socket.Blocking = true;
int code = e.ErrorCode;
if (e.ErrorCode != WSAEWOULDBLOCK)
{
bexitreadloop = true;
socket.Close();
form1.DisplaySocketStatusMessage("Socket error on read");
break;
}
}
|
|
|
|
|
This is Great, Now I'm working on it.
Thanks for this great reply...
Alper
|
|
|
|
|
im trying to request a web but its needs a proxy with authenticantion i have alredy creat a WebProxy object to setit up the WebRequest.Proxy property but idont know how to configure or setup the WebProxy credentials for this proxy authentification can any one give a hand on this
regards alex
|
|
|
|
|
Hi all,
I have a class that owns a "protected" method (let's say 'Class1'; method: 'AddVar'). Now, I want to use reflection to obtain this class and inherit it to a local class.
Something like:
Public Class LocalClass : Assembly.LoadFrom("..PathToClass1..").GetType("Class1")
I now the line above is too good to be right.
Is what I want even possible? If so, How do I define it?
Thanks
MGKido
|
|
|
|
|
|
To build a class "runtime" using reflection is..."tricky". You need to use classes out of System.Reflection.Emit to dynamically buildup the class and method calls at runtime. Even then, if the protected method is flagged virtual it adds another wrinkle.
All of this is entirely possible (I've done it) but it is not easy nor for the faint of heart.
This leads me to ask this: what are you really trying to do? Isn't the assembly and the class available to derive from? Why bother using reflection to do this at all? You should always avoid solutions that are unnecessarily complex.
|
|
|
|
|
Okay,
1. I almost abandoned the thread because of 2 things:
a. Didn't get any real answers.
b. Managed to do it using a code sample that I (think) dowloaded from this site.
The code uses reflection to display all the methods is a given assembly. I noticed that the code manages to display a protected class (I couldn't even see it - that's why I needed to inherit the class). Then I took the code of getting to the protected class and tried to invoke it. It worked.
For future users looking for the answer - You should use BinsingFlags enumerator to expose the method:
"BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.InvokeMethod"
|
|
|
|
|
I've made a capture application in c# with DirectShow and I currently obtain an output file. I am now developping a video conferencing application and I would like to transform the capture to obtain a stream instead the output file in order to be able to put this live stream on a serveur. And then the participant of the video conference will be able to read the stream from the serveur.
So, I just want to replace the SetOutputFileName function by a system (even by working directly on the COM object if it's not possible with a c# function) to recover directly the output stream.
Is it possible to obtain a stream in output of a DirectShow capture?
Which method can I use in c# to do this?
Thanks for your help
Julien
|
|
|
|
|
Hey Guys !
Anyone knows how to control the space between characters (kerning) using the graphic libraries provided for the .NET Framework 1.1 ?
Thanks a LOT !!!
|
|
|
|