| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi I wrote a little TCP server with MSMWS. A remote Client connects to the service but not all bytes in the in-buffer are passed to the READ command. The last portion is often held back until the peer closes the connection. So my service never finds the 'end of record' marks right. The client is written in Delphi using the FPiette WSocket component. It works fine with Cache in Streammode and other Delphi IP servers. What can I do to make my MSMWS server behave like the others?? OS = WIN2K Updates for MSMWS002.dll and msmdev.dll installed this is the MSMWS serverpart: Testserv ; ;[ 11/24/2006 10:06 AM ] S anEXIT=1 ; ***** only one test yet **************** F D Q:anEXIT ; -- main loop -- .O 56 .U 56::"TCP" S anDEV=$KEY .W /SOCKET("",1954) ; become a listener .D connect .C 56 ; reset socket .Q .; Q ; connect ; -- procedure : handle connection -- N anEXIT,anDATA,X,anREQ,I,FLAG S anDATA="" F anEXIT=0:0:0 D ; -- main read loop -- .R X#1:1 ; read IP-PORT with timeout 1 sec .U 0 W X U 56 .I $ZC S anEXIT=1 Q ; connection terminated by peer .Q:'$T ; timout .; .I X=$C(26) D Q ; request ..R FLAG#1 ..U 0 W !,"**",anDATA,! U 56 ..D PROCESS(.anDATA,.anEXIT) ..Q ..; .S anDATA=anDATA_$C(X) .Q .; Q ; PROCESS(anDATA,anEXIT) ; -- procedure : process input record -- ; ....... etc. ... Any help is appreciated, Thanks Armin |
|
#2
| |||
| |||
| Armin van Harten <vanharten@_remove_ifmd-consulting.de> wrote in news:Xns98856B6D34AE4vanhartenifmdconsult@195.20.2 24.116: > Hi > > I wrote a little TCP server with MSMWS. A remote Client connects to > the service but not all bytes in the in-buffer are passed to the READ > command. The last portion is often held back until the peer closes the > connection. So my service never finds the 'end of record' marks right. > > The client is written in Delphi using the FPiette WSocket component. > It works fine with Cache in Streammode and other Delphi IP servers. > > What can I do to make my MSMWS server behave like the others?? > > OS = WIN2K > Updates for MSMWS002.dll and msmdev.dll installed > > this is the MSMWS serverpart: > > Testserv ; ;[ 11/24/2006 10:06 AM ] > S anEXIT=1 ; ***** only one test yet ......... Removed a few bugs This one works up to now (for those who like to know): Testserv ; ;[ 11/24/2006 10:58 AM ] S anEXIT=1 ; **** only one test yet **** F D Q:anEXIT ; -- main loop -- .O 56 .U 56::"TCP" S anDEV=$KEY .W /SOCKET("",1954) ; become a listener .D connect .C 56 ; reset socket .Q .; Q ; connect ; -- procedure : handle connection -- N anEXIT,anDATA,X,anREQ,I,FLAG S anDATA="" F anEXIT=0:0:0 D ; -- main read loop -- .R X#1:1 ; read IP-PORT with timeout 1 sec .I $ZC S anEXIT=1 Q ; connection terminated by peer .Q:'$L(X) ; timout *** the timeout $T test was in the wrong place .; .I X=$C(26) D Q ; request ..R FLAG#1:1 ..D PROCESS(.anDATA,.anEXIT) ..S anDATA="" ..Q ..; .S anDATA=anDATA_X ; *** here was an error in the previous sample .Q .; Q ; PROCESS(anDATA,anEXIT) ; -- procedure : process input record -- N anHEAD,anATTR,anCONT,anDONE,anCMD,anSERVICE,I ;;;;;;;;,$ET ; ; ******************************* U 0 W !,">>>",anDATA,! U 56 ; ***************************** ............. etc. ... TX Armin |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.