socketread
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    v BEE Commands
       > Variable Operations
       > Conditional
       > Loop
       > Module Calling
       > Remote Calling
       > Authentication
       > Data Access
       v Socket
          o socketcreate
          o socketbind
          o socketlisten
          o socketaccept
          o socketconnect
          o socketread
          o socketwrite
          o socketclose
          o socketcontrol
       > Special Functions
    > Database Operation
    > Content Management
    > Objects and Classes
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> BEE Commands >> Socket >> socketread <=  =>      <  1  >  
socketread – read a message from a socket

BEE Script:   socketread socketObj [maxlength=integer];

 

BEE Tag:      <beesocketread socketObj [maxlength=integer]>

 

The "socketread" command reads a message from the socket.  The content and length of the read message are stored in socketObj%read:content and socketObj%read:length.

In order to read all bytes in the message, you may need to implement the "socketread" command as a while loop:

socketread mySock;

var msgRead = "";

while ({mySock%read:length}) {

        var msgRead = "{msgRead}{mySock%read:content}";

        socketread mySock;

}

// Now msgRead contains the message read from the socket.

 

Note: "socketread" is binary safe.

Parameters

socket (the socketObj) is the name of the socket to read.

maxlength is the maximum number of bytes that the command will read.  If there are more to read beyond this limit, the excessive data will be left unread until the next "socketread" command.

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd