Results 1 to 16 of 16

Thread: [RESOLVED] Winsock Problem

  1. #1

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Resolved [RESOLVED] Winsock Problem

    Dear Sir,
    I have developed a Winsock control application for my office. It is working fine but facing a very triffle and interesting problem. I failed to solve it. Before plunging into it, a little bit idea of the application is essential to grab it correctly. Here it is.
    The application is accepting Metereological data (Messages) in a serial fashion, once in every 6 hours for less than one second (Met data is coming in that fashion only), displying data in a text box, counting number of messages and sending these messages as it is to another machine which is running on LAN. It is then displaying sent messages in another text box and counting number of messages sent. Although some other small requirements also being performed by the application without any problem. Actually these data or messages are not possible to understand as these are only made up of large number of ascii characters. It is also not required to read the message, the destination machine understands all these messages. But there is a special character in the messages (small vertical rectangle type) which is marking the end of a message. I am counting the number of occurrance of that character and counting the number of messages accordingly. But when in use, the application counting the number of messages erratically (approximately 4 to 5 times the number of original messages). When I copy and paste messages in simulated environment (i.e. using two Hyper Terminals, one serving as Met client and another the destination machine, also a client), I am getting the count exactly. I tried storing messages in a variable and counting after one minute using a timer event to avoid instant counting while data_arrival event is executing, but in vain. Message receiving and sending is ok, only problem is counting. I am unable to find the reason for this erratic behaviour. Any suggestion will be highly appreciated. Sorry for explanation at length.

    Regards,
    - Ajoy Kumar Chakraborty

  2. #2
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Convert ur application to support for the UNICODE and Use the API's which is there for handling the UNICODE string. your application will work well. Even u dont have to bother on the soecial charecter which ur getting now.

    --Regards,
    PB

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Winsock Problem

    Welcome to the forums Ajoy Kumar Chakraborty

    Quote Originally Posted by ajoy6296
    ... Any suggestion will be highly appreciated. Sorry for explanation at length.
    I'd recommend determining which character each of them are. Log them to a file. From the text in the textbox, you can loop thru each character and log any characters where their Asc() value is less than 9 (9=tab). After analyzing those characters, you may be able to adjust your counting algo to be more flexible/intelligent.

    My guess is it is either a carriage return or a line feed (when one is only present) or both/same character multiple times (when two or more are present).

    If the characters end up being back to back and you only expect one per message. You might want to do a simple search and replace, something like the following (make all double occurrences a single occurrence.
    Code:
    Do While InStr(Text1.Text, theChar & theChar) > 0
        Text1.Text = Replace$(Text1.Text, theChar & theChar, theChar)
    Loop
    Last edited by LaVolpe; Nov 12th, 2009 at 01:55 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear LaVolpe,
    Thanks for ur suggestion. Here is a part of message extract and my counting methode for ur further refernce.
    -----------------------------
    00004150BI

    339

    HTJB70 EGRR 310600
    GRIB

    00004150BI

    340

    HTJB60 EGRR 310600
    GRIBæR9„BCq°èx6 FC1Ì`" ƒÂ¢ x4 Á°Ôh4FÃA Ø`‚ã²1n5†‚a¼b3
    †Cˆˆ  ‹‡# Ð\
    ¢¡`¼f/
    ÀàHLN+‹Ea°°T)‹ÆB ðp. …ÃÁñ„2 Æ#¨ÔH
    „!PÈ`2
    †ƒAÐøp%
    „Â!P°`, bIf
    ‚ápÀ`2P+•É£áHd* †ÃÆ dœ>ÀàxÂY) 
     


    
    
    

    
    



    
    
    


     



    

    

    


      


     

    
    

    




    

    

    
    
    


    

    

    

     

     

    
     

    


    
    

      
    


    
     



    
       !"#"
    !!"%((&#



     !#%$%(,,+(#
    $%'((&(-///+&   (*)+,,-/1474/)"  *,-..02458=:5/(#-.121158:;>>:50+'!0/35458;=>@A>:72-("
    0047779<>?@B?><82.)$ /169::999=ACB@?=:51+'!,38;?=;:9=EIHCA@:6353**$#  ,79@B?>>=BJMJGG@?@;;711+,&! "',&%!!'$ !! !-7:EEA@A@EJKMLKEA=;;;86830+*,-22+'*01+&')%##!!  #%(((()+.4@IJECEBEIMOPPLIEA@?===:8638;==:558:9542.+(&# "#$$$%(-00/0006CINLHGEEHLRQQQNMKJIGHCFEBDHLIGFEB@?>?D>50.+('*++*()-06::75>AEIKNLJEDGKPSRQOPQQPONMMOLNUTTTRQLHEDBFIE?730.0321.-//19CD?IIGHLONKEDFMQRSSQQQQQQRRUUU[ca^^]\WUOKKOPLG>82466552/-)*6@CJLKKMPOJHIHMSTTSQONPRSUW[_afnoljmiff\XWYXSKC:58879:62-%(28JKKKLLKGHKJLQSSRPOMKKMPV\dlt}‚zyttrkfb^ZUPJC<<=@=<>=71.0EHIHIJFGGKKMOPOMKIFFINU\bls|ˆŽŠ† „€}zvsjd]VUSKDG@?DHKFB=6BEECDDBEIKLNNLIGC@@DIOWaku}„ŽŠ‰ˆ†}{tmf]ZUQSPDILQPJHE=>>>>@@DGHHIIFDA<;=@GT`lz|„‘Œ‹‰ˆ‚{umf`\^bWPSVXUSU79:::<?CDDEECB@=9 :=GP]jv„‰Ž‹‰…‚}xpidgkd_beecd566879>@@@@@??=88<CKR_o}†‰Œ‹ŽŽŽ� �‹‡‚}vontvqnprrt666767;==;<=><744;AJVet~…ˆ‰‰Š‹ŽŽŽŒˆ„{wx}{z{€988766 89868994..29BP\gt{‚…‡ˆ‰ŠŒŽŽŒ‹Šˆ„}„€ƒ‡Ž@=:9655453332,)*/7BO\hpw|„†‡ˆ‹ŒŠ‰‡…„€‡ƒ‰‘•ID>;8532200/+&%&,4@OZdnvz}‚…‡ˆ‹ŽŒ‹‹‹‡†Ž‘•˜™WMC;:52./--)$"!#,8DT_inty}„†Š‹ŒŽŽŽ’”–˜› cUJ>951+,((% !*6DP\ekqv|€ƒ„‡Š‘’““”••™¡§k\N@:5/))$" (2ANX_flrwz~‚‡Œ‘“•—––˜œ £§rbSF>60)& '2@LTZafkqw|ƒˆ’•–——™š¡¤tfXK@72+$"+8DLT\afls{‚ˆŒ“”•— ——™ vj\OB;5-%#,8CKRZ`fmt{‚ˆ‘’””“•˜›xl^QG?80'"$,8CKSZahpv}ƒ‰ŽŽ’� �–wl_ULC:1)$")5@IQY`hov|ƒ‰‹‹ŠŠ“sjaYQI@7.)#!&-9CMT\djrx~„‡‡†ˆ‹ŒŒpic]WOF<4,'%$(.8CMU]dkrx~‚ƒƒ…‡ˆˆojea\VOE<4-*+/6@LS[bipv{~€ƒ„…†Œjhea^YRJ@8215<DNV_fmsx}‚„†‡hfdb_[UMD>:;?ENV^flsy}€‚€‚…„ddca^ZUNGCBDIPW^gntz„ƒ‚```_\XSNKJKPX]dltz‚„…‚€Z\]\ZXUSRRT[`fnu|ƒ„†…ƒ‚XXYYZXXXY[`flrz€ƒƒ„…„‚€YXXYZ[]^`chmsy‚‚‚‚‚~XYZ[^adehlqv{€‚€€€}Y\]_cgjlnquy}€~}}|]`bfknprtxz}~~|{{dfimrtuvyz|}~}|{lnrvxyz{||}~}}swz||}}}~z}€€€€€€‚~‚‚‚ ‚ƒƒ„„ƒƒƒ„ƒ„……„†„„………„……„„7777







    00004150BI

    347
    ------------------------
    I just copied from my textbox content into notepad and then pasted here from notepad. I observed drastic changes in some characters. But see the line just above 347. I am counting that rectangular type of thing at the end of that line in this manner --by comparing this with another same character storing in another textbox and keeping its visibility false.
    Here is the code.

    For i = 0 To Len(Text1) - 1
    Text2 = Mid$(Text1, i + 1, 1)
    If Text3.Text = Text2 Then
    txtIncounter = txtIncounter + 1
    end if
    next

    Here Text1 is the textbox where i am storing whole message (in parallel with the one displaying it) for counting purpose, keeping it's visibility false. Text3 is the textbox where i am storing that character in the form_load event from a text file where i am declaring the character to be counted. I think i am clear now and little bit specific.

    To have the look of actually what i am getting in my displaying textbox, u please copy this extract of message into ur notepad again and u will get it back. I just did it right now for checking and i got back my original extract.
    Hope u can throw some light on it now.

    Thanks and regards

    Ajoy Kumar Chakraborty

  5. #5
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    No matter whatever the character it may be, Ideally speaking it should be able to process.
    So If you support UNICODE string handling, then 100&#37; ur problem will get solve..

    Thx
    -PB

  6. #6

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear prasannabhat,
    I appreciate the way you suggested to tackle the problem, but i am having some limitations to convert incoming stream into UNICODE. Basically i dont know how to do it. Can u please throw some light on it by giving specific example using code.
    thanx and regards
    Ajoy Kumar Chakraborty

  7. #7
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Ok. Sure. Before that can u send me only that block of code which u are using to manipulate the input string.

    Thx
    -PB

  8. #8
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Let me see if there is some tweak in ur code.


    Thx
    -PB

  9. #9
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Ok. Thx Before end of the day i will try to address this issue

    Thx
    -PB

  10. #10

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear prasanna,
    Here is an extract of the block text for which i need a count. Astonishingly, her in my vista os that character is missing completely. In my office, the application is running on XP and it is very much there. Still what i have extracted is here for ur reference.
    -------------------------------
    00004147BI

    678

    HTJC85 EGRR 091200
    GRIBh‘€°O!ˆåÛq¾Ýj-—LVS1°Ýp:ŸXÜÆo7—O¤ÌEó~ÃS¥WŠFáÝ.™J%Òˆ3ÁÐîo;˜
    Å0ØvH)%Û
    VÂÑh´Z®Ù*—#µó

    00004147BI

    679

    HTJC70 EGRR 091200
    GRIBËf3ûºÝq¹\®÷»½®µY±X,Ö»M¶Ùn¶ÚíV«]ªÅ_¥Pi5}^*P§Ô«v+EžÏl»\í—}Æóx»Ýî÷‹*úýÀàðØœ^7'˜ÍZ-6«=ŽÉf³ÛmöJµF«V®×ë¶;-šÍe³Y¬µÊÅ.…<ŸÑh³Ú%‘J¦Õ+UšÍnÍe²YíË•Úítº]o7›åöý€ÁaqÜܦb*Z*V+UеZµ`¯ÕêÕ
    ZµZ®W+5ŠÍbµ_ªÔé”)ôæw9—Ëæs©ÜÞq>*Ð(JuJ*^°Ùí6ûÊãr½^¯7‹Íîý‚Ãcq� �Jm
    ‡H¤R)TʍV¥M§Tju:R¥Q¨Ôiôú“F¡Îæ³)l‚C%“É¥r¹d¶[,”PhTJ]Zµa²Zm–ۍÞñs¹\ï7Ü:*Í&sYÔö}B£Ò©´ªe"—L¦Si•
    •JJ¢OèùÜÊW&Æ£‘Øü‚E$”Jå2)|Êm>*Ò*UŠÕ~Ëi¶Ünvû}Êï{¾`fsy\žS,˜Mg¹å ‡D¢Q(”J=.P§Rht9ÄÞ{=™I#Ñx¬Z-H$I†E‘J泩õ‘N©ÕëÖK]²×l´Û.Wk¼–O)’Çä’y\¾c4œÏç” ôòwD¤R¨ó¹ìÞw1–Lg2ÈìVˆDbQhœN+‡BaÈŒfC)šPhµ
    ¥^·eµY¬¶ %¢ÛŽÈcñøär?!“K&Óy¬Úo<ŸQ'’餮[,—J$r‰Tv‚Áá0x$ƒ@žŽçc*Øù†G¥sIÕ›S©×ì6:íf¯]‘ÇcѸÜV+ŒÇdÒéT¦W4žMg”iÝ"k#Èär)µôö€¿*07óáòú~=Ýîf»E”Ìo·Ü.ˆ´² e;¥Ô©õš½j¡H¦È#ÑÈÜj'ˆDâò4†S*ŽH%“j
    ›ÀcÒ¹Æ@ä{>ßo×ëÙìö}<]MÖ‹!~¹\0W Öc…àýŠÏ¨ôº…B‘=žÇ"Ñ8¤N! „CbQØü–/ ‘IåS)ÔâS,•Éä³Ôæ6ê{=Þχ»Íäòu¹šì†
    ñj®W*– ÆSmÂä{ÊçZi4‰CᐘT*

    00004147BI

    680

    HTJC60 EGRR 091200
    GRIB¸[íöK%žÓj´Ú,Ö:ýŽÏh´Úí–«=–Íi¶ÛmםÊãq»_o7‹ÍÞñs¸Ý®·k*Òív»Ýo7Km¢� �h²Ùm6«e¶ÕjµÛ-¶ë…º×h²Ö«Uªå‚Çb°W*õzå‚Çb³Yí‹5ªÛmµÚ*6«U¶Ým¸Ü-–›-šÏg´Úív«U®Ûm·[-k%†Éb´[-¶ËEžÏhµÛîë]®¡M§Sê5ZÕj©O¦Si•
    V³]°Xì¶›=’Çd²Xl6
    ~¹Z¬UêµJÅn½a±Øì–k5žÕh²×ì5û
    –ËiµÚìö[5žÓl¶ZmÔ:
    ƒB£QéZC¡P蔊}Rµ\®×«ÕÛb¯P¤Rij%‰>ŸÐé4Ê}>¡R®Xkö
    ý‚³W®WkÖ+=žÓe³Ù¬¶kU¦Ñ8™L&3I”Âa2šM&“™ìîu:ŸÑ)tê…J«Z¬SèÓù´Î_/–Ë%’i<¢U,—Lf“:"‘I¥Sª5
    bµ]²Xì–KŠÃc²YerY$–K%‘H¤²‰t¶_2™Ì¦sY¬îƒH¦T)Ôªîq4•H#‘hœV †D"±hÌv="–Lç3‰Äö‡G¨U*•ŠýŠÅa°WkuºÜŽEG£qˆÔv?$’ÉårÉd®W-™Ï(”Šîo0˜Ë$Q¨”2z½Ÿð˜ŒV7ŽGäRiTÂc2™Nhtª}B¥Y¯×«•ÊÕ^±EâÑ(ŒB#� �Åãé ŽG#“ÊæÉtªI!”K$¸ÄF½^Ø"…C¡è”R3"”K%ó Å—K¦Të5šµZ©P‹ÆâPØLƒB!0ؤj5É$ó4ÎAˆÈãètz1
    ‚?^ïWÃáðøz¾°ÃÍäõ}Abù<¦];£ÑéÚ}>¡O¥Ãá°¨úü}>߯ø,2
    ‚Ã# dºe‘9áÑhr)†À_og›½Úëv;Þn÷+U”Çd3[/˜DF-™P(”
    M.‘H¢Àà/÷ÓÙìñy<žÏÈ÷‡D¢Ñé,Ž+‹‹Äâ1˜´v+ ƒ¿Ÿ/7[ÀârºͶBáf°X,W¬V›‰÷••ͧs©üú{={½žn×k¹Öêx<ß/—£®ŽF¡Ñ¸„2‡: ðˆT

    þ}<\ÆËi¸Þn5X‹2D¢Q%Ô
    ¶ Š ”Ëæ“™¼ÍÜëtºNÖæu¼x,F%ˆÄ!è4~?_o·ãáÜÞlµšÍV«MœÂV§SI„Úa� ��E¦Vm§ì.9#—Ke®—;ÂÝm¸í÷u¼ëx= °Ød
    öú{>ÏGKÅÔðx»œm–»Q¤Ðf³Xëõji"”I$OG´
    5:µl;°ØÄŽ>æm4Úmfã‰ÌÓm9/ˆ\.#x=^ÏWÃíêïr9®'}°Ói´ÙìÆK€¶T&Èärð{>¡ÒŠS)Ôû†E£mf›A’Êh6œw;z ƒÁ*xÝ´ów9Ü-Öóu¾ÝmµÌÖsA’Å`®Öj„Â5ŠŠ@ŸÎÇD
    )(²]¶/øl]œÉd±ØÌ¦“]¼ã}>_/w›ÉìøzºÜ*¶£Y¸Üj4šMk!Ée/×kUj‰&ˆCŸg3±ìüK+Xî'›¹ée±ŒŒf3%®ãx¼Ýïs¡Æçv»ÝÎvóe®Ôh³™ìöS%”� �b±Xk¥z¥<Aކã™èþI§VL×kµÈﲘKÖ
    Òn»]î·[*ÆÝq»]Ηq°×g3L¦CÇb°×뵂‘6?ͦÓAÐüƒL©VŒ†»Æçp²˜K¥ë”În¹].w3¡Èàt;N6óa¬Ïe1ØŒ%úírµZ*Jõix7KK†QéšS.˜L–kE¦Ñd°×+•û–Øo7Ûî Êäo¶Ú*&ƒ%ŽÆ_®ÖŠÅ:¡H*Q(Ô 4!ÌÎW&“ G*eF°Z®×kÕêñŒÀ\.WÌfCM°Ûo7îãe¢Êb°˜«õÚÝ`¤O§HÔ*-$’AœÌå2

    00004147BI

    681

    HTJC50 EGRR 091200
    GRIB¹Ý.´ªU.—L§Tj•j*b·[¬Ö«Uë
    ŠÇa°XlÚÝvÃg¶[nkÍòû~¿àðØ|. ‚¿`07Ì€¾Þn¶ëM²Ûm¶Ûmöû}¾áp¸Oè‰G¥SiÕ
    RŸQ©Õ+ªír»[¬V+Êýž×o¸\ïÛö
    ˆÅb°Ø|N# ‚Á_ïØ íòùx»[í¶Ëe®Õj´Ú*6«]²m7œÎg3¹ìþ‡G¤ÒiTºU&—O©ÕjÕjN§U¬Ö+öK5ªßt¼ß/Ø<&…Ààðx<ýz¼^ï7‹ÅÖåh´Yìö‹U®ÕjµÚ*Ùt¶[-˜Íg3™äö{:Ð(4:-&™N¦Ó)Õ
    µZ³]¯Ø,v›]Êë{À_ï׋¥Öëz¾]n׋*Æçs¹[í–{5ª×g²Y,–k-–Ë$‘Çãò4¢O(”Ë%²Édºg7Ïètj=&•M¨Õ*õšÝ~Áa±XlV‹U¶×c*Õêö
    ŠÍl¶Z*‹=šËV«×¬V ~½^®Wcx¬R+‹DâQHÄf7I%2ÙŒÚw?*Ðèôªe6•J§Tê•
    m*“G¡Ð'“©ÜÞqE¥R©•*Ív³Z*Ökú…Z³Y«Uju:¼> …B ðXL*
    …Ã"1XÌj/”Kæs‰õ<œÎ§³Ùôîi0–Éä1H”:ŒGå ÄòyB¦Óªê]2•Q¬Uêµ::“ÀŸ¯Çãéú?àPX\BˆÅ#Ó´²g0”IdÒ©T¢SŠEa7óñýƒÃ!Ñ8ÜŠ S.™MgTJ-…A¡Ñé´Úu*‘F|>ž¯7“ÉÞóz=^Ï—ô
    €Á!±¨Ô^5ŒC¢0èdB/
    ƒB Ï×Óáìø|>¨.)‘Ê¥³)„Êo:žNç”*%‰D*¼®·K•Êãs9.·{Åâõz½à¸ŒJ- †@^ï×Üþ~ÀoGk¥Ìæp5šg¹ðüÀá±ÙŽC$—Í&³yí<ž¹n'u¸Ün6›*öó}Äë{ ?¯è*~=ÞÏG«åèöy¼
    öëU*Èc1˜Ì¦›Q˜ÉfµÝox2)ÉåÓ ¬Úo5n¶›
    f£Q¬Òh´šmvëqÒó|?ßÐ õìówºÝNç[¥ÒámµZl¶ñ|¿^¯WëÕb‰F¨Z±ZŽ|
    É$²™\©¤Òi3ٍS)šÑi4[-·;Ùê÷{=^O[¼Ün·Û*–£5”Æ`.–«uÒål´Y(’)šY@§W±\/‡ü"'È$LÖk!„Âd0¬¬¦31šÙn¸]/›½Æâq7
    f“9˜Êa°˵ºÍb²Z*VJÕR‡D"PètBQ`Îq;Ÿ°ˆ„Z(Éa°—K…êõ„Àb²š
    ‡±äðo·Û*v£IšÌc0—«Õêñn´X+•ËŠÁZ§Q¦‘$

    00004147BI

    682

    HTJC40 EGRR 091200
    GRIB»Ý®ôŠ=‡C¢QhôšmN*X«Ö«ÖžÓk·[î •Êçu»]n·{½Úíx¼Þ¯W«Íêù|¾ß¯wËíöû|½Þ¯{Õâõ}¾ß/—Ëåêõy½P'óéìòy=ŸÐhÔڍN©V«×+ö-žÛq¹Üî—k½î÷{½^¯w»Íâóz¾^ïWËíöû¾ß/·Ëíö÷z¼^o›Íê÷|¾^ïW«Õêg3™Ìæ³i´Þs<*Ñ©tÊuB§W*׬–‹mÆéw¼^oØ þ¿_¯×ûõöû}¿`08~¿_o·ëÝâïy¼Ý®×{µÚïw»^/Y4¢U,—L&3)œÖu>¡Ñ(´ªuN±]±Y*w*Òï~¿ßð8,„Âá°¸L†Ãa0¸\€¿ß/w«ÅÚéqºÝnw;ÒéŽÈ$RID¦U*”Ê¥³ œâ{@¢R)•½zÇh´Úm· ¥æû¿á0Ø|>‡Âá0ؼn'‰Ãá°ø\
    öõ|½Þ.–û¥Îçs¹Ü¢qX¼j7ŽG£ÑØäzG'”˦sYÝ‹K§Ôêõªõ†Çg·].÷›ö †Äbq8œ>Çã±Øì^#‰Âßï—»Ýæãs»]nwt*
    †C!°ÈL&‰ÅãqÈô†Y2›Oh4J%&›R¬WkÖ;U¶áu¼ß/—Ûö ‚¾ßpù †?Åapø;õòóq²Øì¶K=²àþ?Ÿ×ûõû

    00004147BI

    683

    HTJC30 EGRR 091200
    GRIB˜Ì¦PxL2ŒF£q¨Üj1ŒŒF#x¼^-ŠÅã¨ìv=È$R)$žQ(”Ê¥2y<¦U-—K¥Òù|¾a0—L%²Ù„Êe1˜Ì%òét¾a1™@`pX<*ŠEcÈÜf3F£1˜Ä^-ŒF£qØôz? È¤R9,šO(”Ê$ò‰TªU,—Kå²Ùl¶[.—K¥Ó”Êe/—Kåó ŒÉìú@`phT6!ŒG#‘¨Ür;ŽÇ#q˜¼^1Ç#ñùŠG$’Éd’I$–M&“Iäòy<žS.–Ë%’¹d ¾c.—Lf3”Æa1™M&Ž·sÉîý€@*ШlN5ŽÇcòüz=ŽÆãxÄf5È$2)’I&“Ê$ÒY$–M '”IåyL²[,–JåÓŒÂa1™L¦SŒÆdÜp9n÷«îƒÂâ1ˆô‚C#’Hä2~;Æã‘ù ŠG$’É¥‰,’M(“Éå‰L¦W+”Ê¥’Éd®[/—Ì&9œÎg3™LYlö«qÄçu½Oø"ŽHdRYD¢O&’Èä2‚E$“IäòyD¦U+•Ê¥2yDžO)•Ë% ²Ùd®U*–Ke²Ùl²]0˜L&ébõ€Åe4íÇ¡Üõ~A!0ø¼‚M)•Ke’©D¦Q)”Ê¥RÉl²W,–K%’Ùtº]-—K¥²ét¾a0—ËåÒÉlº]+”Êe’ÙdªL°Z-×kæšÒl8]WÓþ
    G£²(üŽK(–JåÒét¾_1˜Ìf3„Âc2™Í&³i´Öi4šLæsŒÂa/—K%rÉl²Y*R©•*ÅzÅf¶^0ٍfóÊçs¼`hl:%ŒGd9DªY-˜L%òù|Æe2™M&ó™Üú@ŸÏgS‰¼Òg2™Leò¹T¶a1˜¦“©ôúLªV¬—,3-œÎj6›îGC¹ñ„B¡ñ´f7ŠDâq8”R-‹Æäi\Âq?¢Q¨´)ìêu7šÌ¦Ré\¦U+•¤’©tÒuB¤T+–‹…Û€Çe2YL¶“e¼âs»^� �ãéöôw:ÝnÇsÁâô{>àP¨”fC*™Ïh”Zö{8™Kå’‰$’EF#’I4ºm@¥U+«ºÝv¹Z®W� �&#’Íi¶m¶Óq´Öi´ÚV³]°Ún¸ÎçÄ-#—M§séìîi,”Hã±xœ9‹F£Ò©TÒu>*P)
    åj±V¬X+ÕË’Ùx¾a0X,5û|½^¯—«¥¢½`¶a´Ü/ F9$–ÌfrÙ<Š;‡@ßhd2!ŽD¤Ñ¨ÔzA0¡N¨” Ôâi6žQ©U*åšÕh³W+•Š¥J•@™I£Ò eÁ€Ðq<ðh|Z;Eb0ØCñäA*ЈT
    þy>!I2%ŠF£‘éDÒq@¤S)ÊE}4•F¡ãÉØòƒE$”‹f#Eºë|Á ðøŒ:~½ç“Ùý‚>'#yÔêl9O¨2%J&“©ÄÂQ(G"OÇ3q¸Úl5›gƒú)>©V*X
    WKÕîú€?ÞŽÇPÜu? çƒ¹Ìàs9šÎ#±àö~A¡Ñ(Ôj1‡B OçSQÈh1ŒŒæc9°ê~F%ÓIµ"ÝšØn¹î‡+°Ì2›O£¹ÀÞq6 æƒa¼äu<χÔ

    00004147BI

    684

    HTJC25 EGRR 091200
    GRIBt:Œö‹I¤Ñh3ÙŒ¦KŠÅc²ÌÌV+”Ìg´š-ƒI¦Õk5Û-–Ëa¬Ök6-–Ëe²Úm6ۍÖãq¸Ûn7›ÍÖó}Àßp8\.Êçt3Í›Q¨Òh4 ö[ŽÉd²ìì†K-˜Îg³Ùí‹I¦Ôk6-¦Ói²Øk¶-¦Óm¶Ûn7›*Öëq¶Üo7œ'Æãq8\.'•šÍf3ÚMfÃ]¬Ôj4ÙìÆk9œÌf3ŒÆk5šÍg´-›Qª×l6[mÖãm¶Úm·¶ãuºÞo7›ÍÆãqºÝo¸Æãr9\Ì&C-–ËgµMÖãm²×i´šM&‹A*Ðg3™ìökE¢Ói4š*f»e²Ûm¶ÛÆãuºÞn·[*Öó}Àào7[*ÆÛu¾àp¸œnG+•δ\°˜ì†K1¢Öm·›*¦Ã]¬×j´Úm6›I¢Îf´ZM&›I¦Ôk6›m¶Óm¸Ýo7›Íæãu¾ßo¸¾Þn·[΍Èår¹TjuzÝ~Ãc2™*&Ãu¼Ým¶›-¶Ë]¬Ök5,æ‹M*Òjµš*fÃe´Ûn7¶ë…ÀÞn7[Íöó}Ààp8\.Âãq¸Ün'E,S+–Ëö3)˜Ñj¶›*æëq¸Ýn6›
    †»Y¦Ói´ÚfÃa®Øl¶›Öë}Àßp8œ
    æóy¼ßo7›*Öû‰Äâq9®W…Â|B¢’‰õ:Áp¿b2lö›a¸Þo7œN7 y¸Ùm6-¶ãq¸Ün7*æûÀáp¸ÜÎg+Äßo¸íöóuºÞp8\ng;•Äß:OHT’e>£T«×,&œÒk¸‡;•Êåp7›î ‰Âàp¸\NG3¥Ôés¹œŽWC©Öês8ÜnG…Âàp7Û*ç •ÐçršMfóº H¦T*•’éz¾b²ÙÍ›e¼áp7ÛíçÂÞo¸œî·{Ñî÷y¼ž/'‹¹Üïx¼]î—;Êår¸œ-æãyÄâp̦Éàü…F¤Rɵ
    N®W+•ëEû’Îh5í¦Ûqº×k6ç•Èär:NçƒÅæ÷}>ß/G{µØés¹-öëuºÞ,

    ã±éˆF#ÒI„âq>šM¨”êÅ‚Ñr¿b²YŒ¶K!ŠÇd2 ¦[1œÒl7N‡kÑûƒA ÇËÙâêr8*¦Ã\¬]1ÎGâŒF#ÒidšM$˜N§TJUJ½f³[*—+µÊåj³Y*W+ÆŽÌj7/Gô" †B*¯×›*ÄÛj4YÅ"ɐÒh5ÎÈŽŽE"ÐÈDB5"”J¥SIõ"V«Uª•
    U2N©Uª•jõ˪ãw¾àphT2}<
    Ö£-ŒO,˜ ÆsAÀÚu;ŸçiÜö{>Ÿ¨$"L'jòe.–K%’©$‚1•P+Ø ÆËàõ}À 0ãÕÜâk2×å±xÊd3šÌ†“‘ÜÎk:ŽfãI*Òo;ŸÐh”Z9‹D!ˆ4 øþz:ÏhTz}bÀi7\ާƒÁàòy:ÛÍ6Bèª[1L†C9€Äc. f#€¼_/—Œ†Ã©ðþ}>NÇC‘¸Þj3›M&39ÄüŠL+l†sQ²Ýo8œMæ»EŽ»*—Œ†c„ÈY(K’±T� �R(”Ê¥³˜Öo7›
    S)ŒÂ`0Jå‚ÙlÊr?¢Óе¢áxÄd³™l¶[)ŠºT“Jæ€À](’ÉDòi,”H$ $²‘`ºb2Ë…ÂÑd°W*IÄ¢aH¼m9*“
    5B*Z²\®VËE¢Ùb¨N’
    ²ép¶S%¤’)r9Gäry\´[+•J¥R¡HœN'“‰„’qdÒr?¤“êe2™H§Q(S©¤Úm,Ž"“
    å²ÑTšF!Hd1øäd.È$¢‰d°R(”J%¡P¢O(”Ê%ÓAÀüM©*Têu.™M$‘ˆ”2†K+— %0øx<ŒÅã!ˆÌp@$”
    …‚‘8œO'”Š…"‘\°Z1›(´²‰T§P'Éb%
    }<‡ä‚±lªKãa*Ä^, ÇdbqL¬V(I$¢iT¤U,—‹¦#9å—R« ô‚1ˆˆ>ž&£0ô‚Q+ˆƒ˜À`.
    "ÁüšU,Š$²1”Q/KæñxÄuC¥”ÊÅ:e†CŽf£9¬Þ: ¤QàÈZ*Šâq@*`?&‹"YˆˆH&KÆCl®Z7*’J5J‰,‡B¡Gc‰Ôêr ÇÄAèÌV(‰„‚A(B.JEY ˆD&•̆£TœP0éµm ‡@ŸÏgÃáèðu Fc±¨°L#ˆÄ"

    00003715BI

    685
    ------------------------

    Can u notice a blank space after 00003715BI type of string. The vertical rectangular type of character was just after this string and marking the end of a message. I have pasted a few messages here for u. At present i am at home and having vista. On 15 nov09, i will be able to send u the actual block having that character. But for conversion, u can take any odd character from above for the time being.
    Hope this will help u to proceed.
    Also is there any way to interprete this horrible text into readable form in English ? If so, suggest please.

    Thanx and regards

    --Ajoy Kumar Chakraborty

  11. #11

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear pasanna,
    Actually i am extracting that character from a .ini file into a textbox and kept its visibility false. Then in another textbox, storing the incoming stream and comparing each character with the one stored in the textbox having visibility false. If ok, count is incremented by one. Her it is.
    ------------
    For i = 0 To Len(Text1) - 1
    Text2= Mid$(Text1, i + 1, 1)
    If Text3= Text2 Then
    txtIncounter.Text = Val(txtIncounter.Text) + 1
    End if
    Text2 =""
    next
    ------------
    Text1 is the text where i am storing incoming string.
    Text2 is the text where i am extracting one char at a time
    Text3 is the text where the character is stored during form_load and whose visibility is kept false.
    Hope u got it now
    Thnx and regards
    --Ajoy Kumar Chakraborty

  12. #12
    New Member
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Ok.. I will look in to that.. in the evening I will become free,, So that time I will look in to that,

    Thx,
    -PB

  13. #13

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear LaVolpe,
    Surprisingly, extract of message, just uploaded by moderator, not showing that character. I am presently using vista where the notepad also not showing that character. In my office, the application is running on xp where it is clearly visible, but that is not a matter. Counting of any rectangular type character will do.
    Thnx and Regards
    --Ajoy Kumar Chakraborty

  14. #14
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Winsock Problem

    From what you posted, it appears every message is terminated with something similar to the following:
    00004150BI
    The above translated: Chr(10), Chr(3), 10 chars for msg name?, Chr(1), Chr(13)

    If that is true, then your counter may be able to use that pattern... Sample
    Code:
        Dim lPos As Long
        Dim sTokenStart As String
        Dim sTokenEnd As String
        
        sTokenStart = Chr$(10) & Chr$(3) ' change if needed
        sTokenEnd = Chr$(1) & Chr$(13)   ' change if needed
        
        Do
            lPos = InStr(lPos+1, Text1.Text, sTokenStart)
            If lPos Then
                If Mid$(Text1.Text, lPos + 12, 2) = sTokenEnd Then
                    Debug.Print Mid$(Text1.Text, lPos + 1, 12)
                    ' increment counter here
                End If
            Else
                Exit Do
            End If
        Loop
    However, if the first message as you posted does not begin with the sTokenStart characters, you will have to modify the routine. In post #4 & post #10 above they did not.

    Another pattern I see is this. After the 10 char msg name, comes:
    Chr(1), 2 pairs of vbCrLf, 3 digit number

    There are more patterns too. Since the data being passed is most likely binary, I seriously doubt you can rely on a single character for your counter.


    P.S. I believe unicode has nothing to do with your situation. But by all means be willing to try any logical solution.
    Last edited by LaVolpe; Nov 13th, 2009 at 09:44 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  15. #15

    Thread Starter
    New Member ajoy6296's Avatar
    Join Date
    Nov 2009
    Posts
    7

    Re: Winsock Problem

    Dear LaVolpe,
    Thanks for ur suggestion. Actually, since counting is not mandatory in my application, i did not pay much attention to the message pattern so far, but your keen observation had compelled me to achieve the objective by hook or by crook. Your suggestion of avoiding counting message ending with single character (assuming binary data) is the one which did not trigger me so far. You are absolutely right. I noticed a fixed repeatitive pattern of 3 characters (BI) from the string of 13 characters, as you noticed. Those are the last 3 characters. I have taken into consideration of this set of 3 chars for the identification and YES, I got the count absolutely perfect. So thanks a lot for ur help.

    Can u tell me why a single char not suitable for counting if data is binary ?
    Is it possible to decode those horrible characters into readable format ?

    Any way, Thanks again for your right inkling to solve the problem.

    Regards,
    Ajoy Kumar Chakraborty

  16. #16
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Winsock Problem

    Glad I could help. Please indicate thread is resolved from the "Thread Tools" dropdown menu near the top of your first post above.

    Trying to parse on a single character will probably never work unless the format you are parsing only uses that character for a specific purpose. Binary data could use all 255 "characters" in its data or not; you'd only know for sure if you know the format completely. I do expect the format you are parsing is broken into parsable sections.... something like message name, binary data, object count/line number (whatever that 3 digit number means). Parsing can be very simple or very complex.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width