No. This isn't rentacoder - if you want something writing then you write it yourself. Also, this is the .NET forum, which has absolutely nothing to do with Java. I suggest, if you're going to try and pretend you know how to code, you learn the basics.
Suppose the communication error is cable disconnected, absolutely no way to communicate.
When I re-open the connection the instruction:
should give an exception (SocketException) but it doesn't.
Until the communication is interrupted, I could say that it is not a very serious problem because the application tries to communicate with the PLC, it fails and the "close-reopen connection" loop restart (with 10 seconds of pause between one retries).
The true problem is when the communication error is solved: I re-connect the cable.
In this situation the instruction:
doesn't give any exception, and should not, but it doesn't establish a connection so the application tries to communicate with the PLC, it fails and retries the connection.
I takes 4-5 attempts to establish a TRUE connection, almost a minute.
I looked for a solution in this and other forum and in MSDN and I found that there is a bug in the TcpClient Close method but the soution, close also the network stream, doesn't work.
I tried to close and dispose all I could with no result.
When I close the connection I need to be sure it is closed and I can't succesfully open it when the cable is disconnected!
You've tried to help me, I can only thank you even if I have not solved the problem!!
...and now I've learned one more thing!
I don't think that the problem is at the other end of the connection, ie at the PLC, for two reasons: 1- I have disconnected the cable so the PLC can do nothing; 2- there is another touch panel connected to the PLC, a standard HMI, and it works fine with disconnections and re-connections so the PLC seems to behave in the right way.
I live in an area where the Internet is 1Mbps. It is a slow Internet connection to play games online and play on google chrome youtube simultaneously.
Youtube video load all possible speed, that causes slowness in the online game.
I would like to limit the bandwidth of google chrome to 0.5mps as this runs the online game, and drop velocity when you stop running the online game.
I do not know how to start. Any ideas?
All the ideas are welcome. Thank you,
Or, you may try running YouTube in a virtual machine; you may be able to throttle the virtual internet connection. You need to pick a virtual machine host (Oracle VM; Hyper-V) and have access to an extra OS you can install.
This really isn't a code problem. You COULD do it but you'd be writing a proxy server. That's an awful lot of work for little gain.
If your artificially limited connection cannot keep up with the playback, YouTube is going to detect the limited bandwidth and automatically go down to a lower resolution to download less data while keeping up with the playback speed. You can get around that by selecting the resolution you want but the playback will pause every few seconds while the player waits for more data.
Seriously, this is solved by not playing YouTube videos while you play the game or by selecting a low resolution playback. It's not solved by writing code.
Do you want to write/create a solution or do you just want a solution?
If the former then you would need to
1. Learn how IP traffic works
2. Learn how browsers work
3. Learn how to create a server
4. Learn how to work with threads and sockets
5. Learn how to throttle when reading a stream
6. Put the above together to create a proxy server.
If you want the latter then the following worked well for me for limiting bandwidth for a browser. You must however remember to stop it when the throttling is no longer needed.
When i bulid my application it showing errror like
Error: " Could Not resolve the com reference 65e121d4-0c60-11d2-a9fc-0000f8754da1 version 2.0. Object refrence not set to an a instance of Object " in vb.net
i do know how to solve this error ?