Server hendle multiple connection .. i want advice

hi every body ,
i am working in a network project , my project to make server and connect it with multiple clients in the same time,the server send messages to the connected clients in the same time (multicast) ,and the clients can not
send to the server, i make a loop to accept connection and put them in linked list (handle connection in a linkedlist), when the server want to send a message for the clients , it loops on the linklist and sent the message
for each connection .
my qustion is: do u think that it is a good idea?
if you have better idea , could u please tell me?
thank u

If all you are doing is broadcasting to all the clients and one thread does the job, I would suggest you have just one thread.
Otherwise you could have a work queue for each thread, e.g. a BlockingQueue where each thread take()s from the queue then next thing to send. To get all threads to send a message just add the message to every queue.

Similar Messages

  • Can we open multiple connections to APNS Feedback Server

    Hi,
    Is it recommended/allowed to open multiple connections to APNS feedback server to poll the bad tokens?
    The idea is to run a timer task (every hour) on a n application server which will poll the apns feedback server to retrieve the bad tokens and then close the connection every one hour from N app srevers.
    If it is allowed, can multiple parallel connection get the same bad device tokens connected/read at same time?

    You are literally correct in that IP addresses can be spoofed.
    But the same argument can be made about any single, known, form of security.
    If I know it is the fingerprint from your left index finger that is required ... I've no doubt I can break in if I want to badly enough. Sorry about the finger.
    Security comes from layering multiple, unknown, security measures.
    Mix invited nodes with a known userid
    SELECT sys_context('USERENV', 'OS_USER') FROM dual;
    and the hacker has to know both a valid IP address and who is supposed to be there.
    Now on top of that add the operating system information:
    SELECT sys_context('USERENV', 'TERMINAL') FROM dual;
    and it becomes a bit more difficult.
    Layer on a few more and it becomes exceedingly unlikely anyone will get in that doesn't belong there.

  • I have multiple SSID, but want users of a single SSID to be redirected to a HTTP or HTTPS URL (LAN SERVER for authentication)

    Hi team,
    I  have multiple SSID, but want users of a single SSID to be redirected to a HTTP or HTTPS URL (LAN SERVER for authentication)
    I am very curious and it is important. I want to see how to achieve this with CISCO WLC !!!

    http://10.229.3.99/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=10.229.3.99/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=e8:40:40:ad:cc:80&wlan=MO-GUEST&redirect=www.geo.tv/
    I wanted if someone connects to WLAN "MO-GUEST" automatically the user should be redirected to http://10.229.3.99/login.html and once authenticated by 10.229.3.99 , he/she should be allowed to access anything as normal. [ actually i just want automatic url redirection for the first time for the user of wlan "MO-GUEST"
    waiting expert opinions.

  • Multiple connection server CANNOT be build as rtexe on sbrio 9636

    I am using sbrio 9636. I take the example called "Multiple Connections - Server.vi" And it works OK when the sbrio is connected to the Computer.
    But when I generate the vi to rtexe because that I want to start the vi itself when I boot the sbrio. But after deploy the rtexe on sbrio, it cannot work after reboot. The clients cannot connect to server with socket error code 10061.

    Hi Rudi,
    As per the logs it looks like that file which installer want to use is used by another program. Have you checked this ?
    Also, try to stop all the thing and then check whether any process is running or not. If not then start again.
    If yes, kill that process.
    Thanks
    Sunny

  • Single jdbc connection opens multiple connections to sql server

    Hello!
    I'm having a bad problem, because one jdbc connection opens multiple connections to the sql server. I'm working with the open source jdbc driver jtds and the ms sql server. Because I'm using temporary tables that are only visible to one database connection, my code doesn't work. Is this a bug in jtds or is this the normal behaviour of a java.sql.Connection?
    Here a code example:
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
    conn = DriverManager.getConnection(
    "jdbc:jtds:sqlserver://"+dbConnDef.getServer()+"/"+dbConnDef.getDatabase(),
    dbConnDef.getUserName(),
    dbConnDef.getUserPasswd()
    Statement stmt = conn.createStatement();
    stmt.executeUpdate("SET DATEFORMAT YMD");
    stmt.close();
    stmt = conn.createStatement();
    stmt.executeUpdate("CREATE TABLE #tmp (FieldA INT NOT NULL)");
    stmt.close();
    stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM #tmp");
    stmt = conn.createStatement("SELECT FieldA AS sthElse FROM #tmp");
    ResultSet rs2 = stmt.executeQuery("SELECT * FROM #tmp");
    // the strange thing is, that this second query does NOT yet open a
    // new connection, but the next sql command does.
    stmt = conn.createStatement();
    stmt.executeUpdate("DROP TABLE #tmp");
    stmt.close();
    Why is it behaving that strange way? It is absolutely necessary, that EVERYTHING that I do with my connection is really done on the same connection to the SQL server! How can I force a java.sql.Connection not to open multiple sql-server-connections?
    It is very urgent, thus, PLEASE HELP!!!
    Thousand thanks in advance! Marco.

    ...but that means, that the jdbc driver I use, is not working properly, because it should work the following way (please correct me, if I misunderstood the concept):
    I create a Connection object which should represent exactly one physical connection to the database. Then I can create as many Statement instances by conn.createStatement() as I want. There should still exist only one physical connection.
    With each of my Statement objects, I can create one result set.
    This means, I should be able to create as many result sets as I want to with only one Connection object (and therefor one physical connection) by creating multiple Statements, right?!
    If this is correct, the concept is perfect for me and exactly as I'm used to it by other programming languages. Then, only my jdbc driver does not work properly which means I either have to replace it by another one or change it myself (it's open source).

  • Connecting One process Server to Multiple SAP Systems

    Hi Experts,
    We have a licensed version of the SAP CPS with the Process server limit parameter set to 4, which means we are limited to 4 process server as per my understanding. But when we create a SAP system the process server and the respective Queue is automatically created. SO that means we can create a max number of 4 SAP systems with 4 process servers!!
    Or is there a way we can connect one process server with multiple SAP systems ?
    Thanks,
    Eric.

    Yes - Process server limit parameter set to 4 means your CPS environment can start jobs in 4 SAP systems only.
    Maybe "SAP Business Automation Enabler (BAE) Connectors" could be useful to you in your situation.
    - Check the CPS admin guide for more information on BAE connector.
    Regards,
    David

  • URGENT:Handle multiple connection in a multithreaded server.

    I hava a multithreaded server where it can handle multiple connection.
    The program works in this way. First, it will wait for connection. Once it accepts a connection, it will pass the socket to a thread class which will in turn process the connection. Then, the server will go back to the infinite loop to wait for new connection.
    Since I am not very familiar on using thread, I would like to post the following questions:
    1) Let say that my server can handle multiple connections. This is to cater for the different requests from the client. For instance, the client may make one connection for chatting and another connection for sending file(something like we have in Yahoo Messanger). So, at the server side, how can I differentiate between the connection for CHAT and the connection for SEND FILE so that I can handle the requests separately. It means I can save the file sent from client and display the chat message in the JTextArea?
    2) How can I stop the server, clean up the thread and start the server again for waiting new connection? Currently, I can just start my server once.
    For reference,following are parts of my program:
    public void listenSocket(){
    try{
    server = new ServerSocket(5000);
    } catch(IOException e) {
    System.out.println("Failed to listen on port 5000");
    System.exit(0);
    try{
    while(true){
    server1frame sframe=null;
    ChatHandler handler;
    handler = new ChatHandler(sframe,server.accept(),jTextArea1,jTextField1,jFileChooser1);
    handler.start();
    } catch(IOException e) {
    System.out.println("Accept failed:5000");
    System.exit(0);
    //to close the connection as the final steps before program exit.
    } finally {
    try{
    server.close();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    public void run() {
    out.println("Connection Established");
    out.flush();
    try {
    String line;
         while(!(line =in.readLine()).equalsIgnoreCase("QUIT")) {
    if(line.startsWith("CLIENT"))
    jTextArea1.append("\n"+line);
    else if(line.startsWith("Connecting")) {
    jTextArea1.append("\n"+line);
    else if (line.startsWith("Finish")) {
    JOptionPane.showMessageDialog(sframe,"File has finished downloading",
    "File Download Complete",JOptionPane.INFORMATION_MESSAGE);
    else {
    BufferedWriter fout = new BufferedWriter(
    new FileWriter("e:/num1.txt",true));
    fout.write(line);
    fout.newLine();
    fout.flush(); }
         } catch(IOException ioe) {
         ioe.printStackTrace();
         } finally {
         try {
              in.close();
              socket.close();
         } catch(IOException ioe){
    System.out.println("Fail to close connection.");

    1) Let say that my server can handle multiple
    connections. This is to cater for the different
    requests from the client. For instance, the client may
    make one connection for chatting and another
    connection for sending file(something like we have in
    Yahoo Messanger). So, at the server side, how can I
    differentiate between the connection for CHAT and the
    connection for SEND FILE so that I can handle the
    requests separately. It means I can save the file sent
    from client and display the chat message in the
    JTextArea?Either your server listens on two different ports for two different protocolls, (then you would a server thread for each port) or you accept connections for both protocolls on both ports, and have the client state what protocoll it is using :
    eg:
    accept Connection - start new Thread - read first line - depending on protocoll pass protocoll object (CHAT, FTP) to run method
    There is an example for a simple protocoll at : http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    2) How can I stop the server, clean up the thread and
    start the server again for waiting new connection?
    Currently, I can just start my server once.You normally start servers only once. It should then be up and listening for it's entire lifetime. Restarting a server should only be needed if it hangs or crashes.

  • IPad Mail Creating Multiple Connections with Server

    I am trying to connect with my iPad Mail Client via POP3 to an externally hosted e-mail server. My problem is that the iPad apparently is trying to enable multiple connections to the e-mail server and the protection on the server then bans my IP as a suspected DOS attack. How can the iPad client be adjusted to disable it from making multiple connections?
    And, is anyone else having this problem?

    I found the solution. Fetch is set automatically and that is my problem. Need to change it to manual

  • Creating multiple connection factories from deployed RAR

    Hi
              I'm using WL Server V8.1 sp4 and have successfully deployed my Connector
              Module (RAR) using the Builder tool.
              Within the Builder I can specify default connection properties in the
              deployment descriptor. What I want though is the ability to define
              multiple connection factories with different properties without having
              to deploy/redeploy the RAR for every different connection configuration.
              I can't believe there is a 1-to-1 mapping between the RAR and connection
              factory settings. I've seen that there's a <ra-link-ref> tag available
              in the weblogic-ra.xml but I can't see how to use this?
              Any advice on how to get this working would be greatly appreciated.
              Cheers
              Chris
              

    Hi
              I've had some success but am still confused by the way WLS requires
              second and subsequent connection factories to be created.
              It appears you create a CF within the weblogic-ra.xml deployment
              descriptor using the <map-config-property> tags. All other properties
              are inherited from the settings within ra.xml (we have them set blank).
              If there is no weblogic-ra.xml then a default is created at RAR deploy
              time. We can modify settings and redeploy the resource adapter using the
              supplied Builder tool. There appears to be a limit on what is possible
              with this tool to create CF instances though. It doesn?t seem possible
              to enter config properties here to appear within the weblogic-ra.xml.
              There are fields to allow entry of the CF name and the RA link reference
              though. (This seems strange that it doesn?t provide full flexibility).
              In order to create a CF a certain amount of manual work is required. You
              need to hand modify the weblogic-ra.xml to specify the connection
              properties you want. Then the file has to be added to RAR file for
              deployment using the jar command.
              A second or subsequent CF must also be prepared in a similar way ? the
              properties are defined in weblogic-ra.xml but this time there is no need
              to redeploy a complete RAR file. We can link to the defaults and classes
              provided in the original deployment. This is done using the
              <ra-link-ref> and specifying the connection-factory-name of the original
              RAR. This new RAR only needs ra.xml and weblogic-ra.xml to deploy so we
              can remove any jar files containing code. However, this cannot be done,
              it seems, from the Builder tool.
              I am concerned it seem to be a lot of manual work and, in particular,
              editing of the rar files we provide to our customers. Does anyone know
              of a better way of achieving multiple CF instances without going through
              this process?
              Regards
              Chris
              ChrisWalker wrote:
              > Hi
              >
              > I'm using WL Server V8.1 sp4 and have successfully deployed my Connector
              > Module (RAR) using the Builder tool.
              > Within the Builder I can specify default connection properties in the
              > deployment descriptor. What I want though is the ability to define
              > multiple connection factories with different properties without having
              > to deploy/redeploy the RAR for every different connection configuration.
              >
              > I can't believe there is a 1-to-1 mapping between the RAR and connection
              > factory settings. I've seen that there's a <ra-link-ref> tag available
              > in the weblogic-ra.xml but I can't see how to use this?
              >
              > Any advice on how to get this working would be greatly appreciated.
              >
              > Cheers
              > Chris
              

  • How to control one server with multiple clients via TCP/IP

    I am wanting to control a single server with multiple clients.  Only one client would be active at a time, so there would be no conflict.  I want to use TCP/IP.  So far, I have programmed a cluster that passes data back to the server with no problems.  The challenge come in when a second client is added to the mix.  I have't been able to figure out how to turn each client on and send the appropriate data and then turn it off so it doesn't keep sending the same data to the server. 
    Here are the things that I have considered and did some preliminary testing, but don't really know how to impliment:
    1.  Send a numeric on the front of the cluster packet that tells the server that data is on the way.
    2.  Send a boolean on the front of the cluster packet to somehow turn the server TCP/IP on.
    The problem I have found is that LabVIEW TCP/IP doesn't like to be turned on and off.  If it doesn't get the data it expects, it goes into a reset mode and that kills the response time.
    Any help?

    You should consider implementing a set of simple one-byte commands that can be sent back and forth between the Server and the Clients. You can base all of these ideas off the example in the Example Finder under Networking >> TCP and UDP called Multiple Connections - Server.
    You will have two loops in the server VI: one to wait for new connections, and one to send and receive data from the existing connections. For instance, after one of the clients connects, it can request control of the server to send data to it by sending the character "R" for request. Every time the send/receive loop of the Server executes, the first thing it can do is to check all the existing connections to see if any of the clients have sent a control request ("R"). If so, it will create a buffer (array) of control requests. This could be in the form of Connection IDs or indexes in the array for a particular Connection ID. Your choice.
    After the Server receives a request for contol, if it is not already under control by another client, then it can send a response to the first client on the control request list. For instance, the server could send the first client a "S" command for send. Note that after the clients send their control request, they should execute a TCP Read and wait indefinitely for the server to respond with the one-byte "S" command. Then, once the client in control is finished sending data to the server, it could send the character "X" telling the Server to release it from control.
    The example I mentioned above already does a similar thing. Note how when a client wants to disconnect, they send the letter "Q". You can see this in the Multiple Connections - Client VI. The Server then checks each individual connection to see if it's received this one-byte command, and if it has, it closes the connection to the client. This is what you would want to implement, but instead of having just one command, you'll have to distinguish between a few and build up a buffer of control requests.
    Finally, if a client does decide to disconnect in your application, they could send the command "Q" just like the example above. At this point, close the connection and remove that Connection ID from the array of connections. You will also have to handle the case that this client was in the request control waiting line when it disconnected, in which case you need to delete it from that array as well.
    This will definitely work for you, but it will take some work. Best of luck!
    Jarrod S.
    National Instruments

  • Multiple connection ServerSocket?

    I'm trying to write a simple chat program, with a server, and multiple clients. I just want to be able to have any client send something to the server, and it echo's it back, no matter who sent it. The way I have it now, it doesn't seem to work with multiple connections (fine with just one) Do I need to start a new thread to handle each connection?
    Thanks,
    Alex

    Do I need to start a
    new thread to handle each connection?
    Thanks,
    AlexYes.
    Read here
    http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html

  • WDSMCAST multiple connections 0x800704C3

    We are using WDSMCast.exe to image our computers with Multicast. I do not want to put the password for the command in plane text. WDSMCast says that if you don't specify the /username parameter, it uses the current user credentials.  Those happen to
    the be the system account from Windows PE for a non-domain computer. If it were a domain computer, I might be able to specify "domain computer" as a permission on the reminst share.  But alas, I cannot.
    WDSMCast.exe is being run from a \\server\deployment share.  The drive is being mapped to letter I using a password encryptor tool (loginw.exe).  The I drive maps to the same server that WDS is installed
    to.  When I run WDSMcast.exe without specifying the /username parameter, it uses the same credentials to connect to the
    \\server\reminst share. It can access all the wim image files on there, but I'm guessing it then fails to authenticate to the transport server with the error "Can't find the file specified". 
    When I do specify the username parameter, it complains about multiple connections to the same server, even though the same account is used here as was used on the drive map.
    I understand that I can add wdsmcast to the boot image so I don't have to map a drive to that.  However, there are other scripts, as well as driver stores on the non-reminst share that are needed before and after the multicasting command.  There
    is only one deployment server per site and I do not want to pull drivers and other software over the WAN. 
    So, is there any way to disable authentication on the transport server such that a non-domain system account from WinPE can connect to and image from a WDS server?  I would imagine that if imaging must be done from WinPE that Microsoft allowed for this. 
    I remember back in the Ghost days you didn't need any credentials to connect to a Ghost multicast session. 

    Hi,
    There is a way of disabling the authentication on the transport server at the WinPe phase, you can add a component:
    Microsoft-Windows-PnpCustomizationsWinPE_6.1, then go to the Credentials part, like the screenshot below:
    Note: If the username is not a domain account, the computer name should be used instead of the domain.
    Regards
    Wade Liu
    TechNet Community Support

  • I keep getting notified that there is an important update to Firefox that I need to install but when I click on the icon all that happens is a message that I am connecting to the update server but a connection never happens

    I keep getting a message stating that it is critical that I update my Firefox. I click on the update icon and a software update box shows up and tells me I am connecting to the update server but the connection never happens. I have left it running for hours but no connection ever occurs. Should I ignore this or do I need to go to your website and download from there? I don't want to lose my current settings.

    In the Task Manager, make sure to check both the Applications tab and the Processes tab. On the Processes tab, Firefox may have two different components running: firefox.exe and plugin-container.exe. Well, in 3.5.11, it would be only the first one.

  • Registry name and value to check if server has internet connection

    Hi
    I want to check that if server has internet connection though registry value. Can any one help me the path of registry to check if server has an internet connection or not

    > Martin Can I get the script to check the server has an internet
    > connection ?
    Sorry, I don't have one - we never had the need to check this... Short
    VBS snippet:
    strURL = "https://www.grumpfasdklfhsdf.comm"
    Set objExplorer = WScript.CreateObject("InternetExplorer.Application",
    "IEWindow_")
    objExplorer.Navigate strURL
    Do While objExplorer.ReadyState <> 4
        WScript.Sleep 100
    Loop
    Sub IEWindow_NavigateError( pDisp, sURL, sFrame, sStatus, sCancel )
        WScript.Echo sStatus
    End Sub
     sStatus in the Sub will contain HTTP error codes. 502 for "Host not found".
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Internet Security Warning - The Server you are connected to is using security certificate that...

    Mail Client on Laptop is Windows Live Mail.  Mail server outgoing.yahoo.verizon.net.  DSL Internet.  Long time Verizon customer.  Client configuration settings correct according to Verizon.  I now get an Interenet Security Warning message whenever I start up the Live Mail Client and send an e-mail.  Only happens on sending e-mails.  The warning message comes back looking for a YES or NO answer.  The message is
    "The server you are connected to is using a security certificate that could not be verified."
    "A certificate chain processed, but terminated in a root certificate which is not trused by the trust provider."
    "Do you want to continue using the server?"      "YES    or   NO"
    I click YES in order to successfully send e-mail messages which I do not like to do.  I only have to press YES on the first e-mail message that I send.  The rest outgoing e-mail work correctly after that first one. 
    What has Verizonn done to cause the problem on my client software?  I have done nothing to change configurations on my Windows 7 and Windos Live Mail laptop.  I have done some research, and verified that my computer time and time zone is correct.  I am looking for an explanation on why this is happening from Verizon. 
    HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    If no one has a better idea you may want to unlink Yahoo from VZ. http://forums.verizon.com/t5/Verizon-net-Email/Unlinking-Verizon-email-from-Yahoo-portal/td-p/413475 It is possible to lose data as pointed out in the linked thread.
    OR Did you get any indication that your mail server settings were going to change at the end of Sept 2013? A mass email went out for "standard" verizon users earlier this year.  I am not sure if this effects Yahoo/VZ settings.
    If a forum member gives an answer you like, please give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem. Thanks !!!
    http://forums.verizon.com/t5/Verizon-net-Email/Fix-for-Missing-Inbox-sent-folders-etc-with-Internet-Explorer-11/m-p/647399

Maybe you are looking for

  • BI connectivity with SCM....

    Hi,      I need make a connection between BI and SCM inorder to install the best practices for the scenario SCM in BI. In the BI connectivity B84 document, the steps shows as follows, 2.2.2     Connecting SAP BI to the SAP SCM system Procedure Carry

  • MP3 files not showing in iTunes after importing from Windows PC

    I have my MP3 music files saved on my computer. For some reason when I try to import a particular folder to iTunes Library, only 3 of the 11 files in the folder show up. Why aren't the other 8 showing up? Can anybody help me with this?

  • Reader 10.1.3 for Mac doesn't print pdf's from web

    Yesterday we updated to Adobe Reader 10.1.3.  Now we can't print any pdf's from the web. In some cases we can save the files and open in Reader - those files print. However some web pdf's, like Stamps.com postage, don't allow the files to be saved. 

  • What is this (Account Unknown) SID ?

    sorry.  in part, while i'm chasing this, i just want to rag about the msdn link See relative identifier which points to itself.  grrrrr. question:  what is this weird account   Account Unknown(S-1-5-21-xxxxxxxxxx-yyyyyyyyyy-zzzzzzzzzz-1000)  which ha

  • Can't get to first base using undo and redo

    Hi folks: I'm trying to add undo and redo capabilities to a small application I'm writing with Swing, but I can't get to first base. When I try to establish an undo object like this: final UndoManager undo = new UndoManager(); I get two "cannot resol