• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:40
CEST 22:40
KST 05:40
  • 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 Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris31Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Geoff 'iNcontroL' Robinson has passed away Aligulac - Europe takes the podium A Eulogy for the Six Pool Weekly Cups (Aug 18-24): herO dethrones MaxPax 2v2 & SC: Evo Complete: Weekend Double Feature
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Maestros of The Game—$20k event w/ live finals in Paris Esports World Cup 2025 WardiTV Mondays RSL: Revival, a new crowdfunded tournament series
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
ASL20 - worst advertising ever... BSL Polish World Championship 2025 20-21 September BGH Auto Balance -> http://bghmmr.eu/ ASL Season 20 Ro24 Groups Flash On His 2010 "God" Form, Mind Games, vs JD
Tourneys
[ASL20] Ro24 Group D [ASL20] Ro24 Group F [Megathread] Daily Proleagues [IPSL] CSLAN Review and CSLPRO Reimagined!
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile
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 The year 2050 European Politico-economics QA Mega-thread
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 Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
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
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
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: 1197 users

[H] Named Pipes?

Blogs > Phyre
Post a Reply
Phyre
Profile Blog Joined December 2006
United States1288 Posts
Last Edited: 2009-11-11 03:08:49
November 11 2009 02:39 GMT
#1
Hey everyone, still working on that project from my last blog entry and I've been using something called Named Pipes for my inter-process communication. I've got a few questions if anyone here is familiar with the use of Named Pipes.

The big question I've got is if a server app is going to be sending a constant stream of small messages to a client app should I be creating a new instance of the named pipe every time I send a message and then closing it when I'm done to get ready for the next message or is there a way to keep reusing the same instance over and over?

The other is how do I get the server to accept a second client after the first client has been closed? As of right now I start up my server and connect a client to it just fine, but if I close the client and restart it I can't get it to reconnect to the server.

EDIT: I've got the client reconnecting just find, so the second question is solved. However, I'm doing this by destroying the current instance when the client disconnects and then creating a new one to wait for the next client. I'm not sure if this is the intended way to use Named Pipes.


"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
tarpman
Profile Joined February 2009
Canada718 Posts
November 11 2009 03:11 GMT
#2
From your description I'm assuming you're doing this under Windows. For a constant stream of messages you should keep the same file handle open until you're done your session (much as you would a TCP socket). Have a look at MSDN's example code. If you still can't get it to work pastebin a minimal test case that demonstrates the problem you're having.
Saving the world, one kilobyte at a time.
MrChance
Profile Joined March 2009
Germany51 Posts
Last Edited: 2009-11-11 03:24:26
November 11 2009 03:20 GMT
#3
Named pipes don't sound like the right choice here, their functionality is limited and not really suited to client server problems imo. There should be a way to make it work without recreating the pipe and making reconnects possible.

edit:nvm, tarpmans suggestions sounds viable.

However, you might want to take a look at boost.interprocess or the like for alternatives. Boost is a C++ library, but the concepts and different methods there should be available in C# too. That should save you the hassle of forcing the pipe system into something it probably wasn't meant for.

I'm not much of a C# programmer, usually work under linux (where I would recommend sockets )
Hope that helps!
This is just like television, only you can see much further
Phyre
Profile Blog Joined December 2006
United States1288 Posts
Last Edited: 2009-11-15 15:46:00
November 15 2009 01:19 GMT
#4
On November 11 2009 12:20 MrChance wrote:
Named pipes don't sound like the right choice here, their functionality is limited and not really suited to client server problems imo. There should be a way to make it work without recreating the pipe and making reconnects possible.

edit:nvm, tarpmans suggestions sounds viable.

However, you might want to take a look at boost.interprocess or the like for alternatives. Boost is a C++ library, but the concepts and different methods there should be available in C# too. That should save you the hassle of forcing the pipe system into something it probably wasn't meant for.

I'm not much of a C# programmer, usually work under linux (where I would recommend sockets )
Hope that helps!

I've heard good things about Boost, I'll have to look into that. Funny that you would mention that about linux, a friend of mine I asked about this earlier said the exact same thing.
"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
Please log in or register to reply.
Live Events Refresh
Next event in 3h 20m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
UpATreeSC 126
ProTech105
Nathanias 79
JuggernautJason53
StarCraft: Brood War
Dewaltoss 83
ajuk12(nOOB) 18
NaDa 11
Beast 2
Dota 2
Pyrionflax232
monkeys_forever180
capcasts151
League of Legends
Reynor94
Counter-Strike
Stewie2K550
Heroes of the Storm
Liquid`Hasu451
Other Games
Grubby2558
FrodaN818
C9.Mang0196
IndyStarCraft 138
ToD119
ZombieGrub98
markeloff77
Trikslyr43
Organizations
StarCraft 2
angryscii 22
Other Games
BasetradeTV13
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• StrangeGG 58
• IndyKCrew
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• Migwel
StarCraft: Brood War
• Pr0nogo 6
• iopq 1
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21241
League of Legends
• Doublelift3077
• TFBlade683
Counter-Strike
• imaqtpie988
Other Games
• Shiphtur162
Upcoming Events
Replay Cast
3h 20m
The PondCast
13h 20m
WardiTV Summer Champion…
14h 20m
herO vs MaxPax
Clem vs Classic
Replay Cast
1d 3h
LiuLi Cup
1d 14h
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
1d 19h
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
Big Brain Bouts
1d 19h
Iba vs GgMaChine
TriGGeR vs Bunny
Reynor vs Classic
Serral vs Clem
BSL Team Wars
1d 22h
Team Hawk vs Team Dewalt
BSL Team Wars
1d 22h
Team Hawk vs Team Bonyth
SC Evo League
2 days
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
[ Show More ]
Maestros of the Game
2 days
ShoWTimE vs Cham
GuMiho vs Ryung
Zoun vs Spirit
Rogue vs MaNa
[BSL 2025] Weekly
2 days
SC Evo League
3 days
Maestros of the Game
3 days
SHIN vs Creator
Astrea vs Lambo
Bunny vs SKillous
HeRoMaRinE vs TriGGeR
BSL Team Wars
3 days
Team Bonyth vs Team Sziky
BSL Team Wars
3 days
Team Dewalt vs Team Sziky
Monday Night Weeklies
4 days
Replay Cast
5 days
Sparkling Tuna Cup
5 days
Liquipedia Results

Completed

CSLAN 3
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
Acropolis #4 - TS1
CSL Season 18: Qualifier 2
SEL Season 2 Championship
WardiTV Summer 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

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
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 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.