View Single Post
Old 01-15-2003, 06:38 PM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

---

resource +share channel <shareName> <channelName>

Return: "" on success, error is fatal

---

resource -unshare channel <shareName>

Return: ChannelName on success, error is fatal

---


Use this with locks, to create persistent connections, like:


iputs -nobuffer "Locking and Sharing juliet"

resource +lock "juliet"

if { [catch { set juliet [resource -unshare channel "juliet www server"] }] != 0 }

iputs -nobuffer "Creating juliet"

set juliet [socket www.inet.fi 80]

} else {
iputs -nobuffer "Juliet read from share"
}

iputs -nobuffer "Sharing juliet: $juliet"

resource +share channel "juliet www server" $juliet

resource -unlock "juliet"

iputs -nobuffer "Juliet successfully processed"


*Note* After sharing channel, interpreter does not have control anymore - read/write/etc will return with fatal error.
darkone is offline   Reply With Quote