Writing Strings to Sockets - Program closed: WRS3948

Login to reply to this topic.
Fri, 2005-06-10 20:39
Joined: 2005-06-02
Forum posts: 2
I´m a very beginer with Symbian and I´m trying to modify the Nokia Sokets example to send
   an string (TBuf8) via Sockets. When I try:
     
     TBuf8<2> buf;
     buf.Append('O');
      buf.Append(EKeyLineFeed);
      iSocketsEngine->WriteL(buf);

It works fine, but if I try:

     TBuf8<2> buf;
     buf.Append('O');
     buf.Append('K');
     buf.Append(EKeyLineFeed);
      iSocketsEngine->WriteL(buf);

I get a "Program closed: SOCKETS" and then  "Program closed: WRS3948"
   What this code means?  Huh

    Thanks in advance.

Sat, 2005-06-11 10:31
Joined: 2005-01-04
Forum posts: 226
Re: Writing Strings to Sockets - Program closed: WRS3948
Use this .......


TBuf8<3> buf;
buf.Append('O');
buf.Append('K');
buf.Append(EKeyLineFeed);
iSocketsEngine->WriteL(buf);
Sat, 2005-06-11 23:30
Joined: 2005-01-07
Forum posts: 41
Re: Writing Strings to Sockets - Program closed: WRS3948
The <2> after TBuf means you are creating a length-2 buffer.

Appending 3 characters (O, K, Lf)  causes a "buffer overflow", which pancis under Symbian

This easy-to-miss error, is the most common in application crashes. When you get a panic, always check your TBufs first! I guarantee you that's where it's coming from most the time Smiley
Sun, 2005-06-12 10:44
Joined: 2005-05-09
Forum posts: 33
Re: Writing Strings to Sockets - Program closed: WRS3948
use TBuf8<3> buf; here 3 is the length,

if u don't know the size or u want allocate dynamically then use HBuf
Mon, 2005-06-13 14:43
Joined: 2005-06-02
Forum posts: 2
Re: Writing Strings to Sockets - Program closed: WRS3948
Ok,
  thanks for your help  Grin Grin
 []´s
Mon, 2005-06-13 19:12
Joined: 2005-03-22
Forum posts: 14
Re: Writing Strings to Sockets - Program closed: WRS3948


A logical 0 bit exists of a high puls with a duration time of 600 µs followed by a low puls of 550 µs this. A logical 1 bit is formed by a high on time of 600 µs followed by low signal of 1600 µs.

Can i use this:
Code:
TBuf8<15> aBuf1;
aBuf1.Copy( _L("\b00000011110000"));

iTxData.Copy(aBuf1); //TBuf8<160> iTxData;
iTxComm.Write(iTxStatus, iTxTimeOut, iTxData);  // RComm& iTxComm;

Is it like the stream on the picture?
How to set the startbit and stopbit with the 1 logical and 0 logical like that?
  • Login to reply to this topic.