Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
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
Manuel
Posted 2-Oct-12 8:17am
Comments
Sergey Alexandrovich Kryukov at 2-Oct-12 14:21pm
   
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.
--SA
m.bleimuth at 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?
Sergey Alexandrovich Kryukov at 2-Oct-12 15:17pm
   
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.
--SA
m.bleimuth at 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.
 
Manuel

1 solution

Rate this: bad
good
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:
http://code.google.com/p/jsocket/[^],
http://socket.io/[^].
 
Try to find some more:
http://bit.ly/VpKzi9[^].
 
[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:
http://php.net/manual/en/ref.sockets.php[^].
 
—SA
  Permalink  
v3
Comments
m.bleimuth at 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.
Sergey Alexandrovich Kryukov at 2-Oct-12 15:13pm
   
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.
--SA
Sergey Alexandrovich Kryukov at 2-Oct-12 15:22pm
   
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)?
--SA

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

  Print Answers RSS
0 CPallini 375
1 Sergey Alexandrovich Kryukov 370
2 BillWoodruff 314
3 George Jonsson 279
4 OriginalGriff 217
0 OriginalGriff 5,030
1 CPallini 4,115
2 Sergey Alexandrovich Kryukov 3,554
3 George Jonsson 2,826
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2014
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