• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:17
CEST 10:17
KST 17:17
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Chinese SC2 server to reopen; live all-star event in Hangzhou4Weekly Cups (Oct 13-19): Clem Goes for Four0BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech! Team Liquid Map Contest #21 - Presented by Monster Energy herO joins T1 Weekly Cups (Oct 13-19): Clem Goes for Four
Tourneys
SC2's Safe House 2 - October 18 & 19 INu's Battles #13 - ByuN vs Zoun Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $1,200 WardiTV October (Oct 21st-31st)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
Is there anyway to get a private coach? OGN to release AI-upscaled StarLeague from Feb 24 BW caster Sayle BSL Season 21 BW General Discussion
Tourneys
[ASL20] Semifinal B [Megathread] Daily Proleagues SC4ALL $1,500 Open Bracket LAN Azhi's Colosseum - Anonymous Tournament
Strategy
[I] TvZ Strategies and Builds [I] TvP Strategies and Build Roaring Currents ASL final Current Meta
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Dawn of War IV ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread The Chess Thread Things Aren’t Peaceful in Palestine Men's Fashion Thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1305 users

Java server/client

Blogs > wo0py
Post a Reply
wo0py
Profile Blog Joined July 2006
Netherlands922 Posts
June 01 2009 09:39 GMT
#1
Dear readers,

My first blogpost because blogs are known for problems and such.

I have started programming in Java years ago, but now i have to revisit the Runtime after a long periode of C-sharp and C++ programming.

I have to build a Server who can handle multiple clients, and the client. I tried to build a single-connection-server/client, but both applications wait or sleep for the other side to react.

I hope anyone can help me with this. I have googled for tuts, but i can't seem to get the picture.

tl:dr gimme the source server/client-model java-code or help to create it myself.

We shouldnt recreate anger of the non-virtual world
DeathSpank
Profile Blog Joined February 2009
United States1029 Posts
June 01 2009 10:11 GMT
#2
fun! Sadly I'm of no use I've never touched server programming.
yes.
r3dox
Profile Blog Joined May 2003
Germany261 Posts
June 01 2009 10:44 GMT
#3
depends on how scalable it must be:
http://mina.apache.org/

also simple client/server examples should be everywhere around the net.
yenta
Profile Blog Joined April 2006
Poland1142 Posts
June 01 2009 10:45 GMT
#4
Learn ICE

http://www.zeroc.com/doc/Ice-3.3.1/manual/toc.html
Trutacz Practice Discord - https://discord.gg/PWF7Pv
wo0py
Profile Blog Joined July 2006
Netherlands922 Posts
June 02 2009 21:22 GMT
#5
Thank you all.. but i need to write the code for a server/client model in java programming. Not a server for files or mysql/php.
We shouldnt recreate anger of the non-virtual world
h3r1n6
Profile Blog Joined September 2007
Iceland2039 Posts
Last Edited: 2009-06-03 00:37:27
June 03 2009 00:36 GMT
#6
Have you tried the tutorials from sun? It's what I used to try it out, and it worked without a problem.

http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
FreeZEternal
Profile Joined January 2003
Korea (South)3396 Posts
Last Edited: 2009-06-03 01:01:35
June 03 2009 00:55 GMT
#7
imo mina is overkill. Just go with a simple socket and serversocket implementation.

1 - Create a ServerSocket and bind it to a port number.
2 - Poll on the port. Polling is fine for single threads but if you need this to scale for a lot of connections, you will need java.nio and use selectors along with ServerSocketChannel.
3 - The client will probably use the Socket class and connect to your server. Use it's InputStream and OutputStream to receive and send messages.
Please log in or register to reply.
Live Events Refresh
Next event in 2h 43m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 64
OGKoka 57
StarCraft: Brood War
firebathero 809
sSak 605
Larva 298
PianO 232
Soma 113
Killer 74
Sharp 47
soO 40
HiyA 12
Bale 4
[ Show more ]
Britney 0
Dota 2
XaKoH 406
XcaliburYe130
ODPixel27
Counter-Strike
shoxiejesuss761
olofmeister628
Coldzera 363
allub221
Super Smash Bros
Mew2King97
Other Games
summit1g8820
C9.Mang0478
ceh9439
Tasteless218
Pyrionflax94
rGuardiaN28
Trikslyr21
Organizations
Other Games
gamesdonequick710
Counter-Strike
PGL420
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH187
• LUISG 12
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• HappyZerGling140
Upcoming Events
Wardi Open
2h 43m
Wardi Open
6h 13m
PiGosaur Monday
15h 43m
Replay Cast
1d 1h
Tenacious Turtle Tussle
1d 14h
The PondCast
2 days
OSC
2 days
WardiTV Invitational
3 days
Online Event
3 days
RSL Revival
3 days
[ Show More ]
RSL Revival
4 days
WardiTV Invitational
4 days
Afreeca Starleague
4 days
Snow vs Soma
Sparkling Tuna Cup
5 days
WardiTV Invitational
5 days
CrankTV Team League
5 days
RSL Revival
5 days
Wardi Open
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.