[Gambas-user] Eeek... help. Gambas 3, latest SVN

Anthony Ivan imperious.ldr at ...2360...
Tue Jan 25 20:53:17 CET 2011


If it helps any - Granted this is now talking about serial ports vs 
networking:

In another part of the project I communicate with a VHF radio via RS232 
serial port. In this code I Write Byte[] information to the radio and 
that works perfectly. Because of the way the radio replies I Read single 
byte's back rather than read byte[] so I can't see if that also 
works..... but since write seems to be okay with byte[]/string[] etc it 
might infer the error with the network Socket problem is in how Read 
works (??) when trying to fill something[] array's???

Anthony

On 01/24/2011 08:09 PM, Anthony Ivan wrote:
> Change the types to simple strings and both client and serversocket 
> run perfectly.
>
> If the server socket sends a String[] as below and the client attempts 
> to Read as String[] the client dies in debugging with a signal 11 
> crash. If I change to object[]'s both client and server crash with 
> signal 11 :(
>
> On 01/24/2011 04:37 AM, Benoît Minisini wrote:
>>> Hi Everyone...
>>>
>>> Once again a silly basic question - the answer to which is eluding me:
>>>
>>> I am trying to send a string[] of data from one computer to another....
>>>
>>> THUS on the server side:
>>> Public Sub MessageClients(myMessage As String[])
>>>     Dim varSocket As Socket
>>>     For Each varSocket In Clients
>>>       Try Write #varSocket, myMessage As String[]
>>>     Next
>>> End
>>>
>>> On the Client side....
>>> Public Sub varSocket_Read()
>>>       DIM myData as String[]
>>>       If varSocket.Status<>  Net.Connected Then Return
>>>       Try myData = Read #Last As String[]
>>> End
>>>
>>>
>>> The above creates a signal 11 failure. The data is being sent out from
>>> the server. If I change things around to send and receive a simple
>>> string there is no problem. The question is: How does one receive a
>>> String[] array at the client end?
>>>
>>> Any insight greatly appreciated.
>>>
>>> Anthony
>>>
>> It should work.. :-)
>>
>> Please tell me where it crashes exactly (in the sender, in the 
>> receiver ?) and
>> at which line.
>>
>> Try to write "As Object" instead of "As String[]" in the Read and Write
>> instructions as a workaround to see if you have the crash too.
>>
>> Regards, 
>






More information about the User mailing list