Page 2 of 2 FirstFirst 12
Results 21 to 35 of 35
  1. #21
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    hmm...let me describe the whole process:
    i (IP: 127.bla.bla.bla ) want to play a game of fifa...so i need to host and call some player to play against me. so
    1. i open the software.
    2. select fifa from the list.
    3. click "launch and host"
    4. the software start fifa and send a message on the port 1234
    5. now i wait till one connect to me.

    another player using the same software:
    1. scanning for games..
    2. scan all the IPs given in a text file in port 1234
    3. found one game on IP: 127.bla.bla.bla
    4. display all information about the found game in the JTable
    5. continue scanning other IPs.
    6. stop when all scan finished.

    now if he wants to play fifa he just select fifa from the software and click "launch only"

    rest in manual.

    is it okay?

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    In step 4:
    send a message on the port 1234
    Who is the message sent to? Your computer appears to be a server/host that waits for a client to connect to it.

    Otherwise I guess it could work.

  3. #23
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    yes...send means it makes the information available for all the clients to retrieve. it just opens a ServerSocket

    now the problem is thread...where and how should i implement it?

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    On the server, after the accept gets a connection, create a new thread and pass the socket to it and loop back to the accept.
    On the searching client, I have no experience with opening multiple Sockets so can't advise. I' think you could have several threads trying to connect concurrently to various hosts, but have no idea how many. Parameterize the number of threads you start to try to connect and see what happens at various numbers of concurrent threads trying to connect. Try with 20 and 50 and 100 for example. Let us know the results. There will be a limit somewhere.

  5. #25
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    i saw some serverless softwares that dont require any server to run...just all the clients communicate using a specific port (may be)...how that is done? datagram? can u give me some idea?
    Last edited by GhosT; 10-01-2008 at 09:00 PM.

  6. #26
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Some protocols require one side to listen and the other to talk. I don't know what happens if both sides talk at the same time.
    I other words, one side uses a ServerSocket to listen and the other a Socket.
    I dont' know about using datagrams. What does the API doc say? Can both sides talk at the same time? Which one will hear the other first?

  7. #27
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    lemme do some research...:D

  8. #28
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    EID MUBARAK to u people!

  9. #29
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

  10. #30
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Free to try; $2,300.00 to buy

  11. #31
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    yeah...lolz...but its possible...haha...
    Last edited by GhosT; 10-02-2008 at 07:47 PM.

  12. #32
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    theres a problem...when i run this project through netbeans it runs fine but when i run it through jar it doesnt and doenst show any message/alert...
    this is the message wehn i run it manually from cmd


    any help????

  13. #33
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Your message doesn't show. Please post it again.
    Show both the command you entered and the error message.

  14. #34
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    i didnt know that java has a lot to do with *.dll files...i had some problem with some dlls and i pasted them inside the system 32 folder...and the problem seems to be solved....

    i think jdic package has something to do with dlls.

    another thing is whenever i run an application using exec() command sometimes the application terminates illegally...and show the dont send/send to microsoft message...any one know why??

  15. #35
    GhosT's Avatar
    GhosT is offline Member
    Join Date
    Sep 2008
    Location
    Dhaka, Bangladesh
    Posts
    37
    Rep Power
    0

    Default

    um leaving tonight...close this topic...norm if i need any help i'll contact u through email.
    thanx for ur help so far.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 08-05-2010, 04:49 AM
  2. Looking Up the Address of a Host
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:11 PM
  3. Getting the host of the applet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-10-2008, 02:56 PM
  4. Replies: 0
    Last Post: 02-15-2008, 08:41 AM
  5. Getting host name/address
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-19-2007, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •