KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Sockets: Problem with the send function...

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
SoNix
KiXforms Dabbler
KiXforms Dabbler


Joined: 08 Mar 2003
Posts: 8
Location: Canada

PostPosted: Thu Dec 02, 2004 8:39 pm    Post subject: Sockets: Problem with the send function... Reply with quote

Hi... i tested why i can`t connect to a pop3 server using the Sockets Library of Kixforms.

Using NetCat, i found that KixForms function send, add an additional " " (space) in front of the second packet... Every First packet is Okay. but the second and every other packet has a space in front.
Here is the code i used to test my finding...
Code:

$system = createobject("kixtart.system")

connect()
sleep 2
senddata()

function connect()

 $socket = $system.socket()

 if $socket
  $socket.blocking = 0
  $socket.remoteaddress = @WKSTA
  $socket.remoteport = 23
  $socket.onconnect = "onconnect($$system.eventobject)"
  $socket.onreceive = "onreceive($$system.eventobject)"
  $socket.connect()
 endif
endfunction

function onconnect($socket)
 if $system.error
  ? $system.serror
  return
 endif

 if $socket
    ? "Network connection etablished"
 endif
endfunction

Function onreceive($socket)
 dim $packet

 if $socket
  $packet = $socket.receive()
     if $packet
         ? "Received: "+ $packet
  endif
 endif
endfunction

function senddata()
  if $socket
  $socket.send("Packet1")
  ? "Sending Packet 1"
 ; here is the bug.... every packet after the first packet has a additional space included.
  $socket.send("Packet2")
  ? "Sendind Packet 2"
 endif
endfunction

Thanx... reply welcome! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group