• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 18:45
CET 00:45
KST 08:45
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL Offline Finals Info - Dec 13 and 14! StarCraft Evolution League (SC Evo Biweekly) Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night
Brood War
General
The top three worst maps of all time Foreign Brood War BGH Auto Balance -> http://bghmmr.eu/ Data analysis on 70 million replays BW General Discussion
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile ZeroSpace Megathread The Perfect Game
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
European Politico-economics QA Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
I decided to write a webnov…
DjKniteX
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1606 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
Canada719 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
Patches Events
23:00
5.4k Patch Clash #9
Liquipedia
BSL 21
20:00
RO16: Group D
Bonyth vs StRyKeR
Tarson vs Dandy
ZZZero.O223
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft373
Liquid`TLO 226
elazer 180
CosmosSc2 127
ProTech123
SpeCial 70
StarCraft: Brood War
Shuttle 641
Artosis 477
ZZZero.O 242
NaDa 21
Terrorterran 2
Dota 2
Dendi1588
syndereN626
LuMiX2
League of Legends
Nathanias36
Heroes of the Storm
Khaldor195
Other Games
Grubby5941
shahzam591
XaKoH 95
Maynarde79
Mew2King73
fpsfer 2
Organizations
Other Games
EGCTV2270
gamesdonequick1753
BasetradeTV33
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 60
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Ler93
League of Legends
• Doublelift4101
Other Games
• imaqtpie2238
• Shiphtur231
Upcoming Events
Replay Cast
9h 16m
Wardi Open
12h 16m
StarCraft2.fi
16h 16m
Monday Night Weeklies
17h 16m
Replay Cast
1d
WardiTV 2025
1d 12h
StarCraft2.fi
1d 16h
PiGosaur Monday
2 days
StarCraft2.fi
2 days
Tenacious Turtle Tussle
3 days
[ Show More ]
The PondCast
3 days
WardiTV 2025
3 days
StarCraft2.fi
3 days
WardiTV 2025
4 days
StarCraft2.fi
5 days
RSL Revival
5 days
IPSL
5 days
Sziky vs JDConan
RSL Revival
6 days
Classic vs TBD
herO vs Zoun
WardiTV 2025
6 days
IPSL
6 days
Tarson vs DragOn
Liquipedia Results

Completed

Proleague 2025-12-04
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
Acropolis #4 - TS3
WardiTV 2025
META Madness #9
Kuram Kup
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
RSL Offline Finals
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 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.