#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
#include <newwin000.h>
#include <WSCvcsocket.h>
#include <WSCmessageDialog.h>
static long cnt = 0;

void sock(WSCbase* object){
  //do something...
  WSCvcsocket* sock = (WSCvcsocket*)object->cast("WSCvcsocket");
  char buffer[128];
  sprintf(buffer,"test!!! %d",cnt);
  cnt++;

  //send data;
  sock->write((WSCuchar*)buffer,128);
  newvlab_005->setProperty(WSNlabelString,buffer);

  //receive data;
  buffer[0] = 0;
  sock->read((WSCuchar*)buffer,128);
  newvlab_010->setProperty(WSNlabelString,buffer);

}
static WSCfunctionRegister  op("sock",(void*)sock);
