Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-19-2003
vukicevic vukicevic is offline
Registered User
 
 
Join Date: May 2003
Location: San Francisco
Posts: 34
single stream for two-way communication?

From looking at the documentation, it seems that if I want to use a single TCP stream for all communication (two-way, even, between client and server), I'd have to use Glacier on the server side, and use GlacierStarter. There is some mention of the stream staying alive for two-way communication only while there is an active connection up -- what's the canonical way to create a connection and keep it around for the lifetime of the client?

Also, along with a two-way tcp stream, I'd like to create a parallel UDP port set to use for communication (specifically server-to-client IceStorm broadcasts). However, to get through common NAT setups, the client would need to initiate this connection, and the server would need to use the src udp port as the destination. I've got some ideas on how to set this up, but I'd be interested to hear if there's a standard way of doing this.

Thanks!
Reply With Quote
  #2 (permalink)  
Old 05-19-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,780
Re: single stream for two-way communication?

Quote:
Originally posted by vukicevic
From looking at the documentation, it seems that if I want to use a single TCP stream for all communication (two-way, even, between client and server), I'd have to use Glacier on the server side, and use GlacierStarter. There is some mention of the stream staying alive for two-way communication only while there is an active connection up -- what's the canonical way to create a connection and keep it around for the lifetime of the client?
You don't have to do anything special. As soon as an outgoing connection is also used for dispatching incoming requests, such connection will stay alive until you destroy the object adapter for the incoming requests.

Quote:
Originally posted by vukicevic

Also, along with a two-way tcp stream, I'd like to create a parallel UDP port set to use for communication (specifically server-to-client IceStorm broadcasts). However, to get through common NAT setups, the client would need to initiate this connection, and the server would need to use the src udp port as the destination. I've got some ideas on how to set this up, but I'd be interested to hear if there's a standard way of doing this.

Thanks!
Yes, this works, too. It's quite easy: You must use a "connected" UDP endpoint for the Glacier router. This way, the router port used to receive UDP packets from the client will also be used to send UDP packets back to the client.

A UDP endpoint becomes "connected" by using the -c option. From the manual:

-c Specifies that a connected UDP socket should be used. Causes the server to connect to the socket of the first peer that sends a datagram to this endpoint.
Reply With Quote
  #3 (permalink)  
Old 05-19-2003
vukicevic vukicevic is offline
Registered User
 
 
Join Date: May 2003
Location: San Francisco
Posts: 34
I completely missed -c. Looks pretty straightforward, thank you for the info.. and for the quick reply!

-- Vlad
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is the IceGrid registry a single point of failure? timp Help Center 1 01-16-2006 06:05 AM
One-way communication buffer overflow? brian Help Center 4 07-15-2005 01:04 AM
Ice and single threaded libraries Nis Baggesen Help Center 4 03-22-2005 04:25 AM
ICE1.3 Tcp Communication Problem chaosun Help Center 13 12-03-2004 10:20 PM
ICE calling a Single Threaded DLL amrufon Help Center 7 08-04-2003 09:49 PM


All times are GMT -4. The time now is 07:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.