You are not logged in.

Search results

Search results 1-9 of 9.

Tuesday, November 13th 2012, 12:58am

Author: PaulP

micro server HTTP/HTML

Null pointer exception is due to the line "FChnl.close" (you should remove this, as Fchnl is not used anymore...) Closed socket is hard to reproduce... It can happen if you cancel the connection from the browser I think. Checking for errors before opening the file could help. You should also check that requested file exist, otherwise you will get an error message...

Monday, November 12th 2012, 8:57am

Author: PaulP

micro server HTTP/HTML

For (drastically) better performance, I finally implemented readFileToByteArray from org#apache#commons#io#FileUtils (you need to download http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar and to add it to you project : Project -> References -> add JAR file) Jabaco Source 1 2 3 4 5 6 7 8 9 10 11 Dim ErrString As String = "Error data, Error 404" & vbNewLine & "unknown file" Dim MyFile As java#io#File MyFile = New File(App.Path & "\root" & lefich) Dim Text() As Byte Redim ...

Saturday, November 10th 2012, 8:47pm

Author: PaulP

micro server HTTP/HTML

I got it fixed, but FGet.readFully is SLOW, I don't know why... try jpg file instead for better performance... Jabaco Source 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Dim ErrString As String = "Error data, Error 404" & vbNewLine & "unknown file" Dim MyFile As java#io#File MyFile = New File(App.Path & "\root" & lefich) 'Reading data Dim FChnl As java#io#FileInputStream Dim FGet As java#io#DataInputStream Dim Text() As Byte FChnl = New FileInputStream(MyFile) FGet = New DataInputStream...

Saturday, November 10th 2012, 7:25pm

Author: PaulP

micro server HTTP/HTML

Well done... Well the problem is that Strings in Jabaco are handled as Unicode ones... so at the very time you load characters upper ASCII-128 from a file into a String they get corrupted... Tried to help you by using <Reading and writing binary data> to read file, but I couldn't fix it... sorry... My best results where by using "Winsock1.SendData(Fichier.readAll) ', but data is still corrupted by stupid unicode encoding of strings that I can't circumvent...

Thursday, November 8th 2012, 4:49pm

Author: PaulP

micro server HTTP/HTML

Another way to fix your problem is to move your Winsock1.Listen statement to a Winsock1_Close() sub... Jabaco Source 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Private Sub Winsock1_SendComplete() '------------------------------------------------------ Winsock1.Close Winsock1.LocalPort = 80 End Sub Public Sub Winsock1_Close() On Error GoTo err3: Winsock1.Listen Exit Sub '--------------------------------------------------------- err3: MsgBox "...

Thursday, November 8th 2012, 4:30pm

Author: PaulP

RE: winsock micro-server without picture-content and without link

Quoted from "pystache" My problem today is : wy with my "micro-server" test-sample, i cant see the image content and wy the link is not running ? (on the index page well loaded on localhost). Hello, Pystache. Well, the reason why the image is not showing is because in your code your are always serving the same file (index.html) whatever GET statement has been sent to your server... I don't know the reason why the server hung after sending one file, but I could fix it on my computer by adding th...

Tuesday, November 6th 2012, 11:51am

Author: PaulP

micro server HTTP/HTML

As promised, here is a "proof of concept" code of embedding a Webserver in Jabaco. You will need two jars to be added in "Project -> reference" (http://maven.eclipse.org/nexus/content/r…rvlet-2.5.0.jar and http://repo1.maven.org/maven2/org/eclips…7.v20120910.jar). The launch button will start the embedded jetty server. Everything is done in pure java code, but interacting is possible by modifying the jar wrapper included (java source code is there too). Main part of the java code of the wrapper ...

Monday, November 5th 2012, 10:03pm

Author: PaulP

micro server HTTP/HTML

Hi, I used once Jetty (http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty) to set up a server and call it from Jabaco. I will post some code tomorrow. You need to build a jar wrapper in java to achieve that, but I will post one. Stay tuned.

Monday, November 5th 2012, 4:09pm

Author: PaulP

how to pass a byte[] datatype to a java function ?

Hello everyone, I am trying to make a xml-rpc call using org.apache.xmlrpc.XmlRpcClient. (jar is at http://repo1.maven.org/maven/xmlrpc/jars/xmlrpc-1.2-b1.jar) I need to pass a parameter as a base64 encoded String. To do so, the XmlRpcClient needs the string to be seen as a byte[] type so I ended to write the following : Jabaco Source 1 2 3 4 5 6 7 8 9 10 11 12 Dim TheClient As New org#apache#xmlrpc#XmlRpcClient("http://someserver.x.com") Dim TheParams As New java#util#Vector Dim element As java...

WoltLab Burning Board