Socket using in a swing applet

Based on this example, here’s a simple network client-server pair using Swing. Note some issues related to correct synchronization: The GUI itself is constructed on the event dispatch thread using invokeLater(). In addition, the code relies on the thread safety of append(). Finally, it incorporates a handy tip from the article Text Area Scrolling. Update: … Read more

Client on Node.js: Uncaught ReferenceError: require is not defined

This is because require() does not exist in the browser/client-side JavaScript. Now you’re going to have to make some choices about your client-side JavaScript script management. You have three options: Use the <script> tag. Use a CommonJS implementation. It has synchronous dependencies like Node.js Use an asynchronous module definition (AMD) implementation. CommonJS client side-implementations include … Read more