| | |
Need to open two concurrent Sockets
![]() |
•
•
Join Date: Jun 2005
Posts: 3
Reputation:
Solved Threads: 0
I have an applet that needs to have a sending socket and a receiving socket, each unidirectional, on ports 2001 and 2002. now, i tried making each one in a thread and it did not work. can someone give me a code example as to how to do this? i am desperate for an answer at this point. thank you muchly
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
I'm not completely sure you can do this, but if you can, an extra class that extends Thread should work:
Have the normal class make the calls to the thread class:
Have the normal class make the calls to the thread class:
Java Syntax (Toggle Plain Text)
public class b { public b() { new ThreadClass(socket,2001); new ThreadClass(socket,2002); } } public class ThreadClass extends Thread { public ThreadClass(Socket socket, int port) { //do some crap } }
![]() |
Similar Threads
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Cannot open certain websites, including hotmail (Web Browsers)
- IE 6 Can't open new windows from link clicked (Web Browsers)
- undefined reference errors when using C++ Sockets Library (C++)
- Please Help!?! (Windows NT / 2000 / XP)
- Default program to open *.pdf (Mac Software)
- file unable to open (C++)
- Outlook Takes A Few Minutes To Open (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Very New to java, skeleton of program given
- Next Thread: Suggest me books on Java concept.
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application arguments array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class client code color component count database derby design eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui html ide if_statement image input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel julia keyword linux list loop macintosh map method methods midlethttpconnection mobile netbeans newbie nullpointerexception object open-source os problem producer program programming project projectideas property read recursion reference replaysolutions ria scanner search server set size sms sort sourcelabs splash sql stop string swing testautomation threads transforms tree ui unicode validation windows






