Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] struct.error: unpack requires a buffer of 4 bytes
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Thu, 24 Jan 2019 22:00:28 +0100
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3HbQiTWljaGFlbCBC ZWhyaXNjaCA8b3NzQGJlaHJpc2NoLmRlPohjBBMRAgAjBQJS0sHSAhsjBwsJCAcDAgEGFQgC CQoLBBYCAwECHgECF4AACgkQPBD+ltFwpimlmQCdGgnYuHxoye4vFntyHRcE0Ij0318AoN3s szGyKcKdUmPpgXLhFcNfRGe4uQENBFLSvucQBACRAt3OW7eL8N3OJp2bZz/rRldtxjcViEcd +wpQcL9Ag0b6W7e4cbSc9oSU9MAdOvxR0UxualeRGz37W/VEC8cFZb3kFtRdl66gGygKb7gl 2S27495XEYqE7BBF1HfQDjL9sh5GfuIzORkqhCHSUTdkRuzRPxNQcEYFSrASEi9jQwADBQP9 FeuTC1SJHrX9tP3p4xrEa07XkCq+UzwNhDdezoQfT1CUbOv+LT66yLTXAaiHXelgaPMQO1Oo 76U2z0C1LudkAcDdwJbMuZ0RfDoRjsgfhfvM6kqiP4m0s2NR3Y3O+HKXjwtPbXuDwaYIAIvp aj8b59n7fQyfL6BZsO0QZc0i/t+ISQQYEQIACQUCUtK+5wIbDAAKCRA8EP6W0XCmKY1lAKCc 3miJueOXuvZJWV7qGBQxxyR83gCgxhGPL9OrP22rxNJSo1w5OOUxHsM=
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

Hi,
could you try, whether the error occurs more often when you add another
client? Also can you check whether replacing _socket.send by
_socket.sendall in traci.connection._sendExact helps?

Best regards,
Michael

Am 15.01.19 um 09:07 schrieb ratzenmeier@xxxxxx:
> Hi all,
>  
> since I'm using threading and multiclients in SUMO with TraCI, I get
> "sometimes" the following problem:
>  
> Exception in thread TraciThread:
> Traceback (most recent call last):
>   File "C:\Program Files (x86)\Microsoft Visual
> Studio\Shared\Python36_64\lib\threading.py", line 916, in _bootstrap_inner
>     self.run()
>   File "C:\Program Files (x86)\Microsoft Visual
> Studio\Shared\Python36_64\lib\threading.py", line 864, in run
>     self._target(*self._args, **self._kwargs)
>   File "D:\Repos\xy\abc\communication_traci_to_server.py", line 21, in
> runCommunication
>     self.connection2.simulationStep()
>   File
> "C:\Users\blub\PycharmProjects\abc\lib\site-packages\traci\connection.py",
> line 323, in simulationStep
>     result = self._sendExact()
>   File
> "C:\Users\blub\PycharmProjects\abc\lib\site-packages\traci\connection.py",
> line 102, in _sendExact
>     err = result.readString()
>   File
> "C:\Users\blub\PycharmProjects\abc\lib\site-packages\traci\storage.py",
> line 62, in readString
>     length = self.read("!i")[0]
>   File
> "C:\Users\blub\PycharmProjects\abc\lib\site-packages\traci\storage.py",
> line 37, in read
>     return struct.unpack(format, self._content[oldPos:self._pos])
> struct.error: unpack requires a buffer of 4 bytes
>  
> So, there are three threads: starting the main connection of sumo(client
> 1), starting client 2 an starting a http server.
> I'm also working with a queue to communicate between the client and the
> http server.
>  
> I'm only seeing, that something in the .simulationStep() of client 2 is
> wrong.
>  
> Any help or suggestions?
>  
> Thanks and greetings!
> 
> _______________________________________________
> sumo-user mailing list
> sumo-user@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top