RE: Trying to get started with TCPIP programming
> -----Original Message-----
> From: tadamsmar [mailto:firstname.lastname@example.org]
> Sent: Tuesday, May 06, 2008 7:13 PM
> To: [email]Info-VAX@Mvb.Saic.Com[/email]
> Subject: Re: Trying to get started with TCPIP programming
> On May 6, 5:26*pm, Jan-Erik Söderholm <jan-erik.soderh...@telia.com>
> > tadamsmar wrote:[color=darkred]
> > > We have gas analyzers that are interfaced via serial lines. *The
> > > analyzers have the capability of communicating over [/color][/color]
> ethernet using [color=green][color=darkred]
> > > the same ascii protocol as for serial.[/color]
> > > I have the task of converting from serial to ethernet. *[/color][/color][/color]
But I don't [color=blue][color=green][color=darkred]
> > > know the first thing about TCPIP programming.[/color]
> > > I am looking at tcpip$examples. *I am using VMS 7.3.2.[/color]
> > > tcpip$udp_server_qio.c
> > > tcpip$udp_client_qio.c[/color]
> > > client_qio writes and server_qio reads.[/color]
> > > I could modify client to write a command to the analyzer.[/color]
> > > But I am not sure how to read back the response from the analyzer?[/color]
> > > Or could I use:[/color]
> > > tcpip$udp_server_sock.c
> > > tcpip$udp_client_sock.c[/color]
> > > I could modify client_sock to send and recieve from the [/color][/color]
> analyzer, I [color=green][color=darkred]
> > > guess.[/color]
> > > The analyzer uses port 9880.[/color]
> > > I am not sure how to send and recieve in the same [/color][/color]
> program. *None of [color=green][color=darkred]
> > > the examples both send and recieve a message.[/color]
> > I've looked at the same "problem" lately.
> > Replacing serial connected PLC's (through term-servers using TNS
> > devices) with direct ethernet.
> > I thought the examples (and the socket API programming
> > manual) had good examples. As soon as you have an open [/color]
> socket you can [color=green]
> > read and write over it as you please.
> > The main difference between the "client" examples and the "server"
> > examples, is which end initiates the connection.
> > As sson as the socket is there, there is not that much differences.
> > Anyway, we decided to continue to use term-servers and
> > RS232 connected PLC's for the time beeing...
> > Jan-Erik.- Hide quoted text -
> > - Show quoted text -[/color]
> So, I guess the analyzer that I am trying to connect to has
> already initiated the socket, so it's like the server? It
> appears that the analyzer is just setting there ready to
> respond to commands sent to 9880.
Sort of - typically the device socket "listens" on a specific TCP port number
(9880) for a connect request from the application. You have to set up the socket
on your end to use that port number and "connect" it to the "listening" socket
on the device end. The client example should have all of that code in it. When
your connect completes the two sockets have formed a TCP connection and you can
read/write it like any byte stream. Be careful on the reads - socket reads block
until ALL of the data you requested is received. If you don't know how many
bytes are coming you have to either read them one at a time or set up some type
of timer to complete the read. Again the example should show that procedure.