Ciao,
i need to send data from Glass to a specific device ( ticked printer ) connected into a LAN with a specific IP address. I can do it ? Anyone can help me to define how i can do it and the steps to follow ? Thanks for any considerations, Dario |
Dario,
You should be able to send data directly to the printer using an instance of GsSocket ... take a look at GsSocket class>>clientExample and GsSocket class>>serverExample for examples of reading/writing using GsSocket. In your case you will use the information in the clientExample to connect to your printer and then you will write data to the socket .... Of course this presumes that you know the wire protocol used by the printer and I'm not aware of printer driver libraries for Smalltalk (that could be ported to GemStone) but I assume that they are lying around somewhere... Dale ----- Original Message ----- | From: "Dario Trussardi" <[hidden email]> | To: "gemstone Seaside beta discussion" <[hidden email]> | Sent: Thursday, May 9, 2013 9:35:45 AM | Subject: [GS/SS Beta] Send data to a specific device into lan | | Ciao, | | i need to send data from Glass to a specific device ( ticked printer | ) connected into a LAN with a specific IP address. | | I can do it ? | | Anyone can help me to define how i can do it and the steps to follow | ? | | Thanks for any considerations, | | Dario |
Thanks Dale,
tomorrow i follow your indications, Dario > Dario, > > You should be able to send data directly to the printer using an instance of GsSocket ... take a look at GsSocket class>>clientExample and GsSocket class>>serverExample for examples of reading/writing using GsSocket. In your case you will use the information in the clientExample to connect to your printer and then you will write data to the socket .... > > Of course this presumes that you know the wire protocol used by the printer and I'm not aware of printer driver libraries for Smalltalk (that could be ported to GemStone) but I assume that they are lying around somewhere... > > Dale > > ----- Original Message ----- > | From: "Dario Trussardi" <[hidden email]> > | To: "gemstone Seaside beta discussion" <[hidden email]> > | Sent: Thursday, May 9, 2013 9:35:45 AM > | Subject: [GS/SS Beta] Send data to a specific device into lan > | > | Ciao, > | > | i need to send data from Glass to a specific device ( ticked printer > | ) connected into a LAN with a specific IP address. > | > | I can do it ? > | > | Anyone can help me to define how i can do it and the steps to follow > | ? > | > | Thanks for any considerations, > | > | Dario |
Dale,
> Thanks Dale, > > tomorrow i follow your indications, > > Dario > >> Dario, >> >> You should be able to send data directly to the printer using an instance of GsSocket ... take a look at GsSocket class>>clientExample and GsSocket class>>serverExample for examples of reading/writing using GsSocket. In your case you will use the information in the clientExample to connect to your printer and then you will write data to the socket .... >> >> Of course this presumes that you know the wire protocol used by the printer and I'm not aware of printer driver libraries for Smalltalk (that could be ported to GemStone) but I assume that they are lying around somewhere... >> It works wonderfully, i have a document printed in 1 second. The only problem i found is the difference method implementation of the Socket into GLASS (GsSocket ) and Pharo ( Socket ) Some methods ( write: isActive ) into GsSocket don't have reference into Socket and some works with difference parameters and answer type. " GLASS " socket := GsSocket new. (socket connectTo: portNumber on: aHost timeoutMs: 300 ) ifFalse:[ socket close . Error signal: 'Unable to connect to port ' , portNumber asString ]." " Pharo " socket := Socket createIfFail: [ Error signal: 'Unable to open aSocket ' ]. ( socket connectTo: aHost port: portNumber waitForConnectionFor: 300 ). Do you have considerations about this ? Is the case of implementing the MockGemStone GsSocket into Pharo as subclass of Socket and manage the difference into it ? Thanks, Dario Trussardi >> Dale >> >> ----- Original Message ----- >> | From: "Dario Trussardi" <[hidden email]> >> | To: "gemstone Seaside beta discussion" <[hidden email]> >> | Sent: Thursday, May 9, 2013 9:35:45 AM >> | Subject: [GS/SS Beta] Send data to a specific device into lan >> | >> | Ciao, >> | >> | i need to send data from Glass to a specific device ( ticked printer >> | ) connected into a LAN with a specific IP address. >> | >> | I can do it ? >> | >> | Anyone can help me to define how i can do it and the steps to follow >> | ? >> | >> | Thanks for any considerations, >> | >> | Dario > |
Dario,
I'm glad to hear that you've got this problem licked! I have not tried to address socket portability ... The SPORT package has a portable socket model that provide a solution ... I'm not quite sure of the status of SPORT on recent versions of Pharo though.... Dale ----- Original Message ----- | From: "Dario Trussardi" <[hidden email]> | To: "GemStone Seaside beta discussion" <[hidden email]> | Sent: Thursday, May 23, 2013 3:56:35 AM | Subject: Re: [GS/SS Beta] Send data to a specific device into lan | | Dale, | | > Thanks Dale, | > | > tomorrow i follow your indications, | > | > Dario | > | >> Dario, | >> | >> You should be able to send data directly to the printer using an | >> instance of GsSocket ... take a look at GsSocket | >> class>>clientExample and GsSocket class>>serverExample for | >> examples of reading/writing using GsSocket. In your case you will | >> use the information in the clientExample to connect to your | >> printer and then you will write data to the socket .... | >> | >> Of course this presumes that you know the wire protocol used by | >> the printer and I'm not aware of printer driver libraries for | >> Smalltalk (that could be ported to GemStone) but I assume that | >> they are lying around somewhere... | >> | | It works wonderfully, i have a document printed in 1 second. | | The only problem i found is the difference method implementation of | the Socket into GLASS (GsSocket ) and Pharo ( Socket ) | | Some methods ( write: isActive ) into GsSocket don't have | reference into Socket and some works with difference parameters | and answer type. | | " GLASS " | socket := GsSocket new. | (socket connectTo: portNumber on: aHost timeoutMs: 300 ) | ifFalse:[ socket close . | Error signal: 'Unable to connect to port ' , portNumber asString | ]." | | " Pharo " | socket := Socket createIfFail: [ Error signal: 'Unable to open | aSocket ' ]. | ( socket connectTo: aHost port: portNumber waitForConnectionFor: 300 | ). | | | Do you have considerations about this ? | | Is the case of implementing the MockGemStone GsSocket into Pharo as | subclass of Socket and manage the difference into it ? | | Thanks, | | Dario Trussardi | | | | >> Dale | >> | >> ----- Original Message ----- | >> | From: "Dario Trussardi" <[hidden email]> | >> | To: "gemstone Seaside beta discussion" | >> | <[hidden email]> | >> | Sent: Thursday, May 9, 2013 9:35:45 AM | >> | Subject: [GS/SS Beta] Send data to a specific device into lan | >> | | >> | Ciao, | >> | | >> | i need to send data from Glass to a specific device ( ticked | >> | printer | >> | ) connected into a LAN with a specific IP address. | >> | | >> | I can do it ? | >> | | >> | Anyone can help me to define how i can do it and the steps to | >> | follow | >> | ? | >> | | >> | Thanks for any considerations, | >> | | >> | Dario | > | | |
Free forum by Nabble | Edit this page |