ruby - UNIXSocket .connect() but don't have full path to socket -
this networks project i'm working on. requires simulate bridge. sockets become ports basically.
but told in order unixsocket work needs full path socket , don't know full path is.
is there anyway around this?
s = unixsocket.new(sock_seqpacket) s.connect(padder(lan_one[i])) the part thats going wrong padder(lan_one[i]). padder pads "port" until 108 characters long. anyways because "port" made doesn't exist anywhere. therefore can't path it.
i don't know full path is.
you specify path constructor argument. in other words, path is. opening socket way creates actual file on file system if there isn't 1 already, , fails (or should do) if cannot create file, such because file specified name exists, or because directory segment of specified path not exist.
the part thats going wrong padder(lan_one[i]). padder pads "port" until 108 characters long. anyways because "port" made doesn't exist anywhere. therefore can't path it.
it's unclear me how should proceed. unix-domain sockets don't have ports, per se, , certainly, cannot connect socket not exist. simulate ports paths, though. example, use paths of general form:
/base/dir/application/port do note there system-specific limit on how long names of unix-domain sockets can be.
Comments
Post a Comment