MSMWS TCP server doesnt read all bytes

This is a discussion on MSMWS TCP server doesnt read all bytes within the mumps forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > mumps

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-24-2006, 04:31 AM
Armin van Harten
Guest
 
Default MSMWS TCP server doesnt read all bytes

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
Reply With Quote
  #2  
Old 11-24-2006, 05:12 AM
Armin van Harten
Guest
 
Default Re: MSMWS TCP server doesnt read all bytes

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:56 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.