• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:39
CEST 18:39
KST 01:39
  • 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
[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature3Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Maestros of The Game—$20k event w/ live finals in Paris10Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6
StarCraft 2
General
Geoff 'iNcontroL' Robinson has passed away RSL Revival patreon money discussion thread Weekly Cups (Aug 11-17): MaxPax triples again! What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : I made a 5.0.12/5.0.13 replay fix
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo) Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
Maps with Neutral Command Centers Flash Announces (and Retracts) Hiatus From ASL [ASL20] Ro24 Preview Pt1: Runway How do the new Battle.net ranks translate? Victoria gamers
Tourneys
[Megathread] Daily Proleagues The Casual Games of the Week Thread [ASL20] Ro24 Group C [ASL20] Ro24 Group A
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Stormgate/Frost Giant Megathread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2863 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 7h 21m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko619
SpeCial 211
ProTech29
MindelVK 28
JuggernautJason16
StarCraft: Brood War
Calm 5050
Bisu 3516
Shuttle 1887
Rain 1386
Flash 1314
Jaedong 1192
firebathero 741
EffOrt 685
ZerO 485
Soulkey 295
[ Show more ]
BeSt 266
ggaemo 259
Rush 181
hero 129
Hyuk 123
Mind 107
Barracks 79
Snow 75
Nal_rA 68
Hyun 60
[sc1f]eonzerg 52
sorry 46
JYJ40
TY 38
Aegong 32
zelot 29
Yoon 29
Terrorterran 19
Sacsri 19
scan(afreeca) 17
HiyA 13
ajuk12(nOOB) 8
IntoTheRainbow 8
Dota 2
Gorgc11285
syndereN553
XcaliburYe304
Counter-Strike
flusha185
Super Smash Bros
Westballz41
Other Games
gofns8734
FrodaN1135
hiko676
Mlord498
Beastyqt397
RotterdaM225
KnowMe205
Liquid`VortiX156
ArmadaUGS110
Trikslyr54
ZerO(Twitch)16
fpsfer 0
Organizations
StarCraft 2
angryscii 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• iHatsuTV 8
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV541
League of Legends
• Nemesis3071
• Jankos1179
• TFBlade516
Counter-Strike
• Shiphtur46
Upcoming Events
Replay Cast
7h 21m
LiuLi Cup
18h 21m
BSL Team Wars
1d 2h
Team Hawk vs Team Dewalt
Korean StarCraft League
1d 10h
CranKy Ducklings
1d 17h
SC Evo League
1d 19h
WardiTV Summer Champion…
1d 20h
Classic vs Percival
Spirit vs NightMare
CSO Cup
1d 23h
[BSL 2025] Weekly
2 days
Sparkling Tuna Cup
2 days
[ Show More ]
SC Evo League
2 days
BSL Team Wars
3 days
Team Bonyth vs Team Sziky
Afreeca Starleague
3 days
Queen vs HyuN
EffOrt vs Calm
Wardi Open
3 days
RotterdaM Event
3 days
Replay Cast
4 days
Afreeca Starleague
4 days
Rush vs TBD
Jaedong vs Mong
Afreeca Starleague
5 days
herO vs TBD
Royal vs Barracks
The PondCast
6 days
Liquipedia Results

Completed

Jiahua Invitational
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSLAN 3
CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
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.