|
-
Nov 8th, 2009, 03:17 AM
#1
Thread Starter
New Member
[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
-
Nov 12th, 2009, 04:25 AM
#2
New Member
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
-
Nov 12th, 2009, 11:30 AM
#3
Re: Winsock Problem
Welcome to the forums Ajoy Kumar Chakraborty
 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.
-
Nov 12th, 2009, 08:59 PM
#4
Thread Starter
New Member
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°èx6FC1Ì`" ƒÂ¢ 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
-
Nov 12th, 2009, 11:54 PM
#5
New Member
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% ur problem will get solve..
Thx
-PB
-
Nov 13th, 2009, 12:04 AM
#6
Thread Starter
New Member
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
-
Nov 13th, 2009, 12:20 AM
#7
New Member
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
-
Nov 13th, 2009, 12:21 AM
#8
New Member
Re: Winsock Problem
Let me see if there is some tweak in ur code.
Thx
-PB
-
Nov 13th, 2009, 12:30 AM
#9
New Member
Re: Winsock Problem
Ok. Thx Before end of the day i will try to address this issue
Thx
-PB
-
Nov 13th, 2009, 12:46 AM
#10
Thread Starter
New Member
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
GRIBh‘€°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•
•JJ¢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éZC¡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ºÜŽEG£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‹2D¢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ÕjN§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Äf7I%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ŠEa7óñýƒÃ!Ñ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ÈÜf3F£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Üp9n÷«îƒÂâ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œN7y¸Ù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ª•
U2N©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ÃáèðuFc±¨°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
-
Nov 13th, 2009, 01:04 AM
#11
Thread Starter
New Member
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
-
Nov 13th, 2009, 01:12 AM
#12
New Member
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
-
Nov 13th, 2009, 01:14 AM
#13
Thread Starter
New Member
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
-
Nov 13th, 2009, 09:30 AM
#14
Re: Winsock Problem
From what you posted, it appears every message is terminated with something similar to the following:
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.
-
Nov 15th, 2009, 06:14 AM
#15
Thread Starter
New Member
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
-
Nov 15th, 2009, 01:45 PM
#16
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|