home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!howland.reston.ans.net!spool.mu.edu!olivea!gossip.pyramid.com!pyramid!iphasew!pogo!hwajin
- From: hwajin@pogo.iphasew.com (Hwa-Jin Bae)
- Newsgroups: comp.os.vxworks
- Subject: Re: vxWorks Sockets and Pipes
- Message-ID: <HWAJIN.93Jan12152753@pogo.iphasew.com>
- Date: 12 Jan 93 23:27:53 GMT
- References: <1993Jan12.201921.4490@nmsu.edu>
- Sender: hwajin@iphasew.com (Hwa-Jin Bae)
- Organization: Interphase West, Santa Clara, CA
- Lines: 34
- In-Reply-To: dog@xdev.sunspot.noao.edu's message of 12 Jan 93 20:19:21 GMT
-
- >>>>> On 12 Jan 93 20:19:21 GMT, dog@xdev.sunspot.noao.edu (Fritz Stauffer) said:
-
- Fritz> 1) writing to a vxWorks pipe returns an ERROR if the pipe is full.
- Fritz> Is there a way to block I/O when the pipe is full, or do I need to use
- Fritz> message queues?
-
- pipe in 5.0 uses message queues, and write() should block if called from
- non-interrupt level code. in earlier versions, pipe used ring buffers
- and write() polled until ring space became available if called from
- non-interrupt level code. if you prefer, you can just use ring buffers
- (ringLib) yourself, and have finer control over what gets done.
-
- Fritz> 2) writing large files on the vxWorks target to the socket to output
- Fritz> on the unix host uses all of the memory up and crashes. This is
- Fritz> because the socket write buffers data in memory. This is okay for
- Fritz> small tar files, but fails on large tar files. Is there a way to
- Fritz> wait for the socket buffers to flush, or to get a socket status as
- Fritz> to how much buffer is left, or any other feedback?
-
- socket level buffers are adjustable with setsockopt() -- SO_SNDBUF,
- SO_RCVBUF. by default TCP uses 4K on each side and UDP uses 2K on
- send side and 4K in recv side. you can retrieve the current limit by
- using getsockopt(). when these high water marks are reached socket
- code blocks until more space become available. inetstatShow() displays
- output similar to UNIX command 'netstat -a', from which you should be
- able to tell various socket level queue length at the time.
-
- hwajin
- --
- hjb@netcom.com (home)
- hwajin@iphasew.com (work)
- --
- hjb@netcom.com (home)
- hwajin@iphasew.com (work)
-