EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem with BeginReceive.

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#14521
Posted: 09/21/2010 08:11:40
by Adam Shaw (Priority Standard support level)
Joined: 09/08/2010
Posts: 10

Hello again,

We have now implemented SBB into our existing application and successfully connected a client over SSL.

We are using async calls due to the way the app currently works, but there seems to be a problem when sending more than one message from the client to the server.

The first message is receieved and a response is sent back to the client correctly and a call to BeginReceive is initiated again on the server side. However the client then sends another message and but the OnReceiveData method is not invoked.

This is the sequence of calls from our logs you can see the Begin and End methods being called in the correct order.

SecureTcpClient is the class that implements the SSB SSL solution. We also have a clear connection back to another back end system.

Client <---SSL---> SERVER (SBB solution) <--CLEAR SOCKET---> Backend system

Also what does the Block property do, should it be set, it didn't seem to make a difference as all the method calls we are using are Async.

"TraxCommSource",Verbose,0,,"Started watching SecurityKey events.",4280,,"10",,1765770384319684,
"TraxCommSource",Verbose,0,,"Started thread that manages sockets.",4280,,"10",,1765770393178520,
"TraxCommSource",Verbose,0,,"Socket returned from factory: Socket Id: b33d0e34-d0af-4d72-b3f5-03162909c665 Host:194.70.30.249 Port:4305 MultiConnect:True Is Encrypted:True Socket state:Closed",4280,,"10",,1765772058711419,
"TraxCommSource",Verbose,0,,"Count of sockets before Add(): 0",4280,,"10",,1765772061868285,
"TraxCommSource",Verbose,0,,"Count of sockets after Add(): 1",4280,,"10",,1765772062034715,
"TraxCommSource",Verbose,0,,"Socket returned from factory: Socket Id: 0fd1a603-6e08-40e0-967c-de527482a1a3 Host:194.70.30.249 Port:7777 MultiConnect:True Is Encrypted:False Socket state:Closed",4280,,"10",,1765772063749599,
"TraxCommSource",Verbose,0,,"Count of sockets before Add(): 1",4280,,"10",,1765772063923092,
"TraxCommSource",Verbose,0,,"Count of sockets after Add(): 2",4280,,"10",,1765772064058608,
"TraxCommSource",Verbose,0,,"Server count: 2",4280,,"10",,1765772074243631,
"TraxCommSource",Verbose,0,,"Started listening on server: 194.70.30.249, 4305",4280,,"10",,1765772438767270,
"TraxCommSource",Verbose,0,,"Started listening on server: 194.70.30.249, 7777",4280,,"10",,1765772445258380,
"TraxCommSource",Verbose,0,,"SecureTcpClient::BeginReceive",4280,,"18",,1765841559377766,
"TraxCommSource",Information,0,,"Client connected, begin receiving data from Client socket id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a Host: 194.70.30.249 Port: 4305 Socket State: Connected.",4280,,"18",,1765841562676489,
"TraxCommSource",Verbose,0,,"Count of sockets before Add(): 2",4280,,"18",,1765841562844347,
"TraxCommSource",Verbose,0,,"Count of sockets after Add(): 3",4280,,"18",,1765841562982574,
"TraxCommSource",Verbose,0,,"SecureTcpClient::EndReceive",4280,,"18",,1765841609953310,
"TraxCommSource",Verbose,0,,"ProcessReceiveBuffer received 641 bytes.",4280,,"18",,1765841675047033,
"TraxCommSource",Verbose,0,,"Contents of cache after reading from receive buffer: <?xml version=""1.0"" encoding=""UTF-8""?><GeneralRequest xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest GeneralRequest.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction>3.0.2.2<LogonNumber>001</LogonNumber>REST<RealTimeReceiver>YSRT</RealTimeReceiver></GeneralInformation></GeneralRequest>",4280,,"18",,1765841711095711,
"TraxCommSource",Verbose,0,,"ETX located at position 640",4280,,"18",,1765841719017176,
"TraxCommSource",Information,0,,"A complete message received in buffer: <?xml version=""1.0"" encoding=""UTF-8""?><GeneralRequest xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest GeneralRequest.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction>3.0.2.2<LogonNumber>001</LogonNumber>REST<RealTimeReceiver>YSRT</RealTimeReceiver></GeneralInformation></GeneralRequest>",4280,,"18",,1765841721500017,
"TraxCommSource",Verbose,0,,"TraxTcpClient::OnMessageReceived sender:Trax.Sockets.XmlMessageBufferProcessor buffer contents:<?xml version=""1.0"" encoding=""UTF-8""?><GeneralRequest xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest GeneralRequest.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction>3.0.2.2<LogonNumber>001</LogonNumber>REST<RealTimeReceiver>YSRT</RealTimeReceiver></GeneralInformation></GeneralRequest>",4280,,"18",,1765841723310866,
"TraxCommSource",Verbose,0,,"Message recevied on socket: 46992c08-8b22-4f3a-b834-2ecea7de9f3a message queued for processing: <?xml version=""1.0"" encoding=""UTF-8""?><GeneralRequest xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralRequest GeneralRequest.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction>3.0.2.2<LogonNumber>001</LogonNumber>REST<RealTimeReceiver>YSRT</RealTimeReceiver></GeneralInformation></GeneralRequest>",4280,,"18",,1765841906172029,
"TraxCommSource",Verbose,0,,"SecureTcpClient::BeginReceive",4280,,"18",,1765841906598695,
"TraxCommSource",Verbose,0,,"Searching socket cache for id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a",4280,,"13",,1765842172729785,
"TraxCommSource",Verbose,0,,"Cache count: 3",4280,,"13",,1765842172966501,
"TraxCommSource",Verbose,0,,"Cache socket Id:b33d0e34-d0af-4d72-b3f5-03162909c665 :Socket Id: b33d0e34-d0af-4d72-b3f5-03162909c665 Host:194.70.30.249 Port:4305 MultiConnect:True Is Encrypted:True Socket state:Listening",4280,,"13",,1765842176659802,
"TraxCommSource",Verbose,0,,"Cache socket Id:0fd1a603-6e08-40e0-967c-de527482a1a3 :Socket Id: 0fd1a603-6e08-40e0-967c-de527482a1a3 Host:194.70.30.249 Port:7777 MultiConnect:True Is Encrypted:False Socket state:Listening",4280,,"13",,1765842176986211,
"TraxCommSource",Verbose,0,,"Cache socket Id:46992c08-8b22-4f3a-b834-2ecea7de9f3a :Client socket id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a Host: 194.70.30.249 Port: 4305 Socket State: Connected",4280,,"13",,1765842177207797,
"TraxCommSource",Verbose,0,,"Id;46992c08-8b22-4f3a-b834-2ecea7de9f3a;Remote Ip;194.70.30.249;Remote Port;4276;CertificateSerialNo;+07:5c:c3:3e:00:00:00:00:03:19",4280,,"13",,1765842184866127,
"TraxCommSource",Verbose,0,,"Socket returned from factory: Client socket id: d5fc8548-4684-4a30-bd82-7291189ed3b1 Host: 194.70.28.102 Port: 2303 Socket State: Closed Trax.Sockets.ClientSocket",4280,,"13",,1765842202189323,
"TraxCommSource",Verbose,0,,"Socket state: Closed",4280,,"13",,1765842206106114,
"TraxCommSource",Verbose,0,,"Socket state: Connecting",4280,,"13",,1765842211597590,
"TraxCommSource",Verbose,0,,"TcpClient::Connect:SocketState == SocketState.Connected",4280,,"13",,1765842250627899,
"TraxCommSource",Information,0,,"Client connected, begin receiving data from Client socket id: d5fc8548-4684-4a30-bd82-7291189ed3b1 Host: 194.70.28.102 Port: 2303 Socket State: Connected.",4280,,"13",,1765842253762435,
"TraxCommSource",Verbose,0,,"Count of sockets before Add(): 3",4280,,"13",,1765842253939482,
"TraxCommSource",Verbose,0,,"Count of sockets after Add(): 4",4280,,"13",,1765842254091224,
"TraxCommSource",Verbose,0,,"Searching socket cache for id: d5fc8548-4684-4a30-bd82-7291189ed3b1",4280,,"22",,1765842337736358,
"TraxCommSource",Verbose,0,,"Cache count: 4",4280,,"22",,1765842337968629,
"TraxCommSource",Verbose,0,,"Cache socket Id:b33d0e34-d0af-4d72-b3f5-03162909c665 :Socket Id: b33d0e34-d0af-4d72-b3f5-03162909c665 Host:194.70.30.249 Port:4305 MultiConnect:True Is Encrypted:True Socket state:Listening",4280,,"22",,1765842338177414,
"TraxCommSource",Verbose,0,,"Cache socket Id:0fd1a603-6e08-40e0-967c-de527482a1a3 :Socket Id: 0fd1a603-6e08-40e0-967c-de527482a1a3 Host:194.70.30.249 Port:7777 MultiConnect:True Is Encrypted:False Socket state:Listening",4280,,"22",,1765842338383140,
"TraxCommSource",Verbose,0,,"Cache socket Id:46992c08-8b22-4f3a-b834-2ecea7de9f3a :Client socket id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a Host: 194.70.30.249 Port: 4305 Socket State: Connected",4280,,"22",,1765842338567547,
"TraxCommSource",Verbose,0,,"Cache socket Id:d5fc8548-4684-4a30-bd82-7291189ed3b1 :Client socket id: d5fc8548-4684-4a30-bd82-7291189ed3b1 Host: 194.70.28.102 Port: 2303 Socket State: Connected",4280,,"22",,1765842338841970,
"TraxCommSource",Verbose,0,,"TcpCLient::Send : SocketState == SocketState.Connected",4280,,"22",,1765842385795426,
"TraxCommSource",Verbose,0,,"ProcessReceiveBuffer received 166 bytes.",4280,,"18",,1765842492676041,
"TraxCommSource",Verbose,0,,"Contents of cache after reading from receive buffer: 10:158:12:18:26:1:1:6:6:7:1:1:::131:124:150:15:20100921 000000:151:15:20100914 000000:152:15:20100707 000000:153:23:155:1:1:154:8:DEVUSR10::156:1:2:157:1:1:194:1:Y:::",4280,,"18",,1765842517691286,
"TraxCommSource",Verbose,0,,"EndOfFmf located at position 166",4280,,"18",,1765842524486118,
"TraxCommSource",Information,0,,"A complete message received in buffer: 10:158:12:18:26:1:1:6:6:7:1:1:::131:124:150:15:20100921 000000:151:15:20100914 000000:152:15:20100707 000000:153:23:155:1:1:154:8:DEVUSR10::156:1:2:157:1:1:194:1:Y:::",4280,,"18",,1765842524677589,
"TraxCommSource",Verbose,0,,"TraxTcpClient::OnMessageReceived sender:Trax.Sockets.FmfMessageBufferProcessor buffer contents:10:158:12:18:26:1:1:6:6:7:1:1:::131:124:150:15:20100921 000000:151:15:20100914 000000:152:15:20100707 000000:153:23:155:1:1:154:8:DEVUSR10::156:1:2:157:1:1:194:1:Y:::",4280,,"18",,1765842524892290,
"TraxCommSource",Verbose,0,,"Message recevied on socket: d5fc8548-4684-4a30-bd82-7291189ed3b1 message queued for processing: 10:158:12:18:26:1:1:6:6:7:1:1:::131:124:150:15:20100921 000000:151:15:20100914 000000:152:15:20100707 000000:153:23:155:1:1:154:8:DEVUSR10::156:1:2:157:1:1:194:1:Y:::",4280,,"18",,1765842525254526,
"TraxCommSource",Verbose,0,,"Searching socket cache for id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a",4280,,"3",,1765842787004742,
"TraxCommSource",Verbose,0,,"Cache count: 4",4280,,"3",,1765842787217845,
"TraxCommSource",Verbose,0,,"Cache socket Id:b33d0e34-d0af-4d72-b3f5-03162909c665 :Socket Id: b33d0e34-d0af-4d72-b3f5-03162909c665 Host:194.70.30.249 Port:4305 MultiConnect:True Is Encrypted:True Socket state:Listening",4280,,"3",,1765842787436482,
"TraxCommSource",Verbose,0,,"Cache socket Id:0fd1a603-6e08-40e0-967c-de527482a1a3 :Socket Id: 0fd1a603-6e08-40e0-967c-de527482a1a3 Host:194.70.30.249 Port:7777 MultiConnect:True Is Encrypted:False Socket state:Listening",4280,,"3",,1765842787624179,
"TraxCommSource",Verbose,0,,"Cache socket Id:46992c08-8b22-4f3a-b834-2ecea7de9f3a :Client socket id: 46992c08-8b22-4f3a-b834-2ecea7de9f3a Host: 194.70.30.249 Port: 4305 Socket State: Connected",4280,,"3",,1765842787817767,
"TraxCommSource",Verbose,0,,"Cache socket Id:d5fc8548-4684-4a30-bd82-7291189ed3b1 :Client socket id: d5fc8548-4684-4a30-bd82-7291189ed3b1 Host: 194.70.28.102 Port: 2303 Socket State: Connected",4280,,"3",,1765842787997771,
"TraxCommSource",Verbose,0,,"TcpCLient::Send : SocketState == SocketState.Connected",4280,,"3",,1765842791632822,
"TraxCommSource",Verbose,0,,"Buffer before indicators are appended: <?xml version=""1.0"" encoding=""UTF-8""?><GeneralResponse xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralResponse"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralResponse GeneralResponse.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction><PreparationDateTime>2010-09-21T14:03:22</PreparationDateTime><Linkages><LinkedMessage>GeneralRequest</LinkedMessage></Linkages></GeneralInformation><LogonAcceptedAndMidnightAlert>2010-09-212010-09-14<PrincipalCodeValueTRAX>DEVUSR10</PrincipalCodeValueTRAX><RTStatusIndicator>YSRT</RTStatusIndicator><ExpectedSequenceNumber>2</ExpectedSequenceNumber><NumberOfDays>30</NumberOfDays><RTSequenceIndicator>NEWN</RTSequenceIndicator><NextRealTimeSequenceNumber>1</NextRealTimeSequenceNumber><ArchiveDate Type=""ARCH"">2010-07-07</ArchiveDate></LogonAcceptedAndMidnightAlert></GeneralResponse>",4280,,"3",,1765842794166111,
"TraxCommSource",Verbose,0,,"Buffer after indicators are appended : <?xml version=""1.0"" encoding=""UTF-8""?><GeneralResponse xmlns=""http://www.trax2.info/trax/schemas/v1.0/GeneralResponse"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.trax2.info/trax/schemas/v1.0/GeneralResponse GeneralResponse.xsd""><MessageHeader><MessageSequenceNumber>1</MessageSequenceNumber>0009</MessageHeader><GeneralInformation><MessageFunction>LOGO</MessageFunction><PreparationDateTime>2010-09-21T14:03:22</PreparationDateTime><Linkages><LinkedMessage>GeneralRequest</LinkedMessage></Linkages></GeneralInformation><LogonAcceptedAndMidnightAlert>2010-09-212010-09-14<PrincipalCodeValueTRAX>DEVUSR10</PrincipalCodeValueTRAX><RTStatusIndicator>YSRT</RTStatusIndicator><ExpectedSequenceNumber>2</ExpectedSequenceNumber><NumberOfDays>30</NumberOfDays><RTSequenceIndicator>NEWN</RTSequenceIndicator><NextRealTimeSequenceNumber>1</NextRealTimeSequenceNumber><ArchiveDate Type=""ARCH"">2010-07-07</ArchiveDate></LogonAcceptedAndMidnightAlert></GeneralResponse>",4280,,"3",,1765842795452008,
"TraxCommSource",Verbose,0,,"SecureTcpClient::BeginSend",4280,,"3",,1765842838471978,
"TraxCommSource",Verbose,0,,"SecureTcpClient::OnEndWrite:result.IsCompleted == true.",4280,,"18",,1765842851741328,
#14524
Posted: 09/22/2010 01:04:30
by Ken Ivanov (EldoS Corp.)

Thank you for reporting the problem. Answered in the Helpdesk.

Reply

Statistics

Topic viewed 1214 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!