Click here to Skip to main content
13,351,731 members (52,531 online)
Rate this:
Please Sign up or sign in to vote.

i am trying to realize some kind of an information system.
The system should work like that:
.Net Program provides Data via a Tcp Server,
Browser clients should connect to server and display the incoming data.
I guess the only way i can do that is via javascript.
Does anyone of you have experience with such things, or can give me advice,
which components i can use for this?

Kind regards
Posted 2-Oct-12 9:17am
What, no server-side technology available? No ASP.NET, not even PHP, for the low-end? (PHP is seemingly available everywhere :-) Doing it on the client side is not beneficial, can be very unsafe, etc.
And now, about the TCP/IP server? What is that, again, fully proprietary application layer? No standard application-level protocol? This also could be a problem.
m.bleimuth 2-Oct-12 14:32pm
Yes php is available, so you mean i should implement the tcp client in php and connect it to my .net tcpserver. Then i can send the data via ajax to my webpage without reloading?
Apparently, you can. The Ajax would just provide the event and pass user data needed for TCP communication, and PHP will generate HTTP response you can use in JavaScript. This way, JavaScript won't directly deal with network. It would create more of the loose binding type of architecture, make the application more modular, improve the possibility for unit testing, so development can be done more smoothly, and results could be more reliable. Using custom (I mean it, custom! something as you have) networking directly with JavaScript is pretty rare, I think.
m.bleimuth 24-Oct-12 4:57am
If i do it with php, i cannot realize if a new client has connected to my System, or wich client has connected? I want be able to send data to specific clients. If i would program the client in .Net i have a socket to each client. Is there absolutly no way of implementing multiple socket connections to each browser client, I know i could do such things with flash or silverlight, but i want do it without any client plugin.


1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please consider my comments to the question as a big warning against this approach.

If you still want to use it, please see:[^],[^].

Try to find some more:[^].

[EDIT: in response to PHP-related discussion in comments:]

This is how you can do it in PHP. For server side, with PHP in particular, custom networking is way more usual, by the reasons I tried to explain in comments to the question (please see the on on PHP) and this answer:[^].

m.bleimuth 2-Oct-12 14:44pm
Thanks for your comments, i guess for my Project security does not matter, because the clients will only run in a local network without internet connection and only for a few hours a day. There is no need to keep the server and client available everytime.
Well, if the solutions exist, somebody use them, and it might be even reasonable. So, your case could be one of them.
Still, considering PHP (I refer to your comment where you answered that it's available to you) should be seriously considered as a more reliable option, even if the security is not a concern. Just reliability.
I added the reference, after [EDIT] and one more comment to the question (about PHP and Ajax).
Please seriously consider doing your custom networking on the server side.

As you got pretty detailed review of available options, will you consider accepting the answer formally (green button)?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100