It is currently Mon May 22, 2017 4:24 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Mixing Socket.file.read.file and socket.client,write.line
Unread postPosted: Sat May 20, 2017 2:27 am 
Offline

Joined: Mon Apr 24, 2017 9:12 pm
Posts: 30
Location: Melbourne, Australia
I have the following code:
---------------------------------------------------------------------------------------
Socket.client.connect ip$, port
.
. % The Server sends a string
.
byte.open W, Fil, "Temp.bas" %
Socket.client.read.file Fil % This works OK, the file is created
.
. % the Server reads a string
.
Socket.file.write.line a$ % I get an "Error writing to socket"
Socket.client.close
---------------------------------------------------------------------------------------
I get an "Error writing to socket"

???

_________________
Stanton's law: When things can not go wrong, they will still go wrong...


Report this post
Top
 Profile  
 
 Post subject: Re: Mixing Socket.file.read.file and socket.client,write.lin
Unread postPosted: Sat May 20, 2017 12:23 pm 
Offline
User avatar

Joined: Sun May 19, 2013 10:53 am
Posts: 512
Before reading or writing to Socket, you should verify if the connection is established. Use Socket.server.read.ready or Socket.client.read.ready to avoid read or write Socket error. See manual page 116.
Alberto

_________________
Even those who assert that everything is predestined and that
we can change nothing about it, still look both ways before they cross the street!


Report this post
Top
 Profile  
 
 Post subject: Re: Mixing Socket.file.read.file and socket.client,write.lin
Unread postPosted: Sat May 20, 2017 12:37 pm 
Offline

Joined: Mon Apr 24, 2017 9:12 pm
Posts: 30
Location: Melbourne, Australia
Yes, I have done that, but I still get the error.
I just did not put it in my example.

_________________
Stanton's law: When things can not go wrong, they will still go wrong...


Report this post
Top
 Profile  
 
 Post subject: Re: Mixing Socket.file.read.file and socket.client,write.lin
Unread postPosted: Sat May 20, 2017 1:05 pm 
Offline

Joined: Sat Dec 22, 2012 2:32 pm
Posts: 830
There is no "Socket.file.write.line", only "Socket.client.write.line" or "
Socket.client.write.file" ( .... but maybe it's only a typo in the post !?)

brochi


Report this post
Top
 Profile  
 
 Post subject: Re: Mixing Socket.file.read.file and socket.client,write.lin
Unread postPosted: Sat May 20, 2017 3:38 pm 
Offline

Joined: Mon Apr 24, 2017 9:12 pm
Posts: 30
Location: Melbourne, Australia
You are right !

_________________
Stanton's law: When things can not go wrong, they will still go wrong...


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
suspicion-preferred